Module: kamailio
Branch: 5.1
Commit: 578e60227859eaead7828924c08d40ae62f6228d
URL:
https://github.com/kamailio/kamailio/commit/578e60227859eaead7828924c08d40a…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2017-12-15T11:51:41+01:00
db_mongodb: fix deprecation warning
Since 1.5.0 mongoc_collection_find() is deprecated
(cherry picked from commit 0ea71ce3cdfb1bcd837f96d8e36e1b296f24a9d6)
---
Modified: src/modules/db_mongodb/mongodb_dbase.c
---
Diff:
https://github.com/kamailio/kamailio/commit/578e60227859eaead7828924c08d40a…
Patch:
https://github.com/kamailio/kamailio/commit/578e60227859eaead7828924c08d40a…
---
diff --git a/src/modules/db_mongodb/mongodb_dbase.c
b/src/modules/db_mongodb/mongodb_dbase.c
index 048d71cdd4..57f11dc930 100644
--- a/src/modules/db_mongodb/mongodb_dbase.c
+++ b/src/modules/db_mongodb/mongodb_dbase.c
@@ -919,10 +919,14 @@ int db_mongodb_query(const db1_con_t* _h, const db_key_t* _k, const
db_op_t* _op
}
mgcon->nrcols = _nc;
}
+ #if MONGOC_CHECK_VERSION(1, 5, 0)
+ mgcon->cursor = mongoc_collection_find_with_opts (mgcon->collection,
+ seldoc, mgcon->colsdoc, NULL);
+ #else
mgcon->cursor = mongoc_collection_find (mgcon->collection,
MONGOC_QUERY_NONE, 0, 0, 0,
seldoc, mgcon->colsdoc, NULL);
-
+ #endif
if(!_r) {
goto done;
}