Skip to content

Commit

Permalink
cachedb_mongodb: Fix compile warning with libmongoc 1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuchircu committed Mar 12, 2018
1 parent 79418dc commit 1237eab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/cachedb_mongodb/cachedb_mongodb_dbase.c
Expand Up @@ -1817,7 +1817,7 @@ int mongo_cdb_filter_to_bson(const cdb_filter_t *filter, bson_t *cur)
int mongo_con_query(cachedb_con *con, const cdb_filter_t *filter,
cdb_res_t *res)
{
bson_t child, bson_filter = BSON_INITIALIZER;
bson_t bson_filter = BSON_INITIALIZER;
mongoc_cursor_t *cursor;
cdb_row_t *row;
const bson_t *doc;
Expand All @@ -1843,12 +1843,15 @@ int mongo_con_query(cachedb_con *con, const cdb_filter_t *filter,

while (mongoc_cursor_next(cursor, &doc)) {
#else
bson_t child;

BSON_APPEND_DOCUMENT_BEGIN(&bson_filter, "$query", &child);
if (mongo_cdb_filter_to_bson(filter, &child) != 0) {
LM_ERR("failed to build bson filter\n");
return -1;
}
bson_append_document_end(&bson_filter, &child);
bson_destroy(&child);

dbg_bson("using filter: ", &bson_filter);

Expand Down

0 comments on commit 1237eab

Please sign in to comment.