How to filter out "_id" from mongodb C driver results -


i have been going through documentation , i'm still lost on how filter out _id results mongodb using c driver.
want functionality i'm not sure

db.collection.find({"test":"pass"},{_id: false}); 

how include projection in c?

cursor = mongoc_collection_find (collection, mongoc_query_none, 0, 0, 0, query, null, null); 

after bit of trial , error able add flags search query. else here format appending no id flag mongoc search.

bson_t *field = bson_new();

bson_append_int32(field,"_id", 0);

to search pattern like

cursor = mongoc_collection_find (collection, mongoc_query_none, 0, 0, 0, query, field, null);


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -