[sr-dev] git:master:e31e4632: db_mongo_db: use mongoc_collection_update() for update operation

Daniel-Constantin Mierla miconda at gmail.com
Wed Feb 11 15:44:26 CET 2015


Module: kamailio
Branch: master
Commit: e31e4632f83e805775bbc1e208178bee11ab137b
URL: https://github.com/kamailio/kamailio/commit/e31e4632f83e805775bbc1e208178bee11ab137b

Author: mikomarrache <mikomarrache at users.noreply.github.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-02-11T10:47:17Z

db_mongo_db: use mongoc_collection_update() for update operation

- used instead of mongoc_collection_find_and_modify(), which returns the
  document, but it is not needed

---

Diff:  https://github.com/kamailio/kamailio/commit/e31e4632f83e805775bbc1e208178bee11ab137b.diff
Patch: https://github.com/kamailio/kamailio/commit/e31e4632f83e805775bbc1e208178bee11ab137b.patch

---

diff --git a/modules/db_mongodb/mongodb_dbase.c b/modules/db_mongodb/mongodb_dbase.c
index 808575b..5acc269 100644
--- a/modules/db_mongodb/mongodb_dbase.c
+++ b/modules/db_mongodb/mongodb_dbase.c
@@ -1226,8 +1226,8 @@ int db_mongodb_update(const db1_con_t* _h, const db_key_t* _k,
 		}
 	}
 
-	if (!mongoc_collection_find_and_modify (collection, mdoc, NULL, udoc, NULL,
-				false, false, false, NULL, &error)) {
+	if (!mongoc_collection_update (collection, MONGOC_UPDATE_NONE, mdoc,
+				udoc, NULL, &error)) {
 		LM_ERR("failed to update in collection: %s\n", error.message);
 		goto error;
 	}




More information about the sr-dev mailing list