How can I do this query in mongoC with bcon_new?
db.users.find({"name": /.*m.*/})
How can I do this query in mongoC with bcon_new?
db.users.find({"name": /.*m.*/})
After few try and error i finally found the answer based on libbson analogy
bson_t *query;
query = BCON_NEW ("name", BCON_REGEX("m","i") );
There is also a specialist for the bson_append_...
bson_append_regex(&doc, "name", -1, ".*m.*", nullptr);
cursor = mongoc_collection_find(coll, MONGOC_QUERY_NONE, 0, 0, 0, &doc, nullptr, nullptr);
There is also a specialist for the bson_append_...
bson_append_regex(&doc, "name", -1, ".*m.*", nullptr);