summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d7aa395)
raw | patch | inline | side by side (parent: d7aa395)
author | Chris Lundquist <ChrisMLundquist@gmail.com> | |
Fri, 13 Jul 2012 01:06:15 +0000 (01:06 +0000) | ||
committer | Florian Forster <octo@collectd.org> | |
Fri, 10 Aug 2012 07:12:11 +0000 (09:12 +0200) |
src/write_mongodb.c | patch | blob | history |
diff --git a/src/write_mongodb.c b/src/write_mongodb.c
index 8d76b608affa4c58d1a3c23cfbeda4f16cc8f5bc..c7b768205cdf2ca59e0938b8b5a955d3deb0e78a 100644 (file)
--- a/src/write_mongodb.c
+++ b/src/write_mongodb.c
/* Assert if the connection has been established */
assert (mongo_is_connected (node->conn));
- status = mongo_insert (node->conn, collection_name, bson_record);
+ #if MONGO_MINOR >= 6
+ /* There was an API change in 0.6.0 as linked below */
+ /* https://github.com/mongodb/mongo-c-driver/blob/master/HISTORY.md */
+ status = mongo_insert (node->conn, collection_name, bson_record, NULL);
+ #else
+ status = mongo_insert (node->conn, collection_name, bson_record);
+ #endif
+
if(status != MONGO_OK)
{
ERROR ( "write_mongodb plugin: error inserting record: %d", node->conn->err);