Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions modules/cachedb_mongodb/cachedb_mongodb_dbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ extern int compat_mode_24;
#define HEX_OID_SIZE 25
char *hex_oid_id;

#if !MONGOC_CHECK_VERSION(1, 29, 0)
#define bson_as_legacy_extended_json bson_as_json
#endif

#define dbg_bson(_prepend_txt, __bson_ptr__) \
do { \
char *__bson_str__; \
if (is_printable(L_DBG)) { \
__bson_str__ = bson_as_json(__bson_ptr__, NULL); \
__bson_str__ = bson_as_legacy_extended_json(__bson_ptr__, NULL); \
LM_DBG("%s%s\n", _prepend_txt, __bson_str__); \
bson_free(__bson_str__); \
} \
Expand Down Expand Up @@ -1309,11 +1313,11 @@ int mongo_db_query_trans(cachedb_con *con, const str *table, const db_key_t *_k,
namespace);

if (is_printable(L_DBG)) {
strf = bson_as_json(filter, NULL);
strf = bson_as_legacy_extended_json(filter, NULL);
#if MONGOC_CHECK_VERSION(1, 5, 0)
stro = bson_as_json(opts, NULL);
stro = bson_as_legacy_extended_json(opts, NULL);
#else
stro = bson_as_json(fields, NULL);
stro = bson_as_legacy_extended_json(fields, NULL);
#endif
LM_DBG("query doc:\n%s\n%s\n", strf, stro);
bson_free(strf);
Expand Down
Loading