mongoc_collection_count()
.This function shall execute a count query
on the underlying collection.
# Wrapper for `mongoc_collection_count()`.
#
# This function shall execute a count `query` on the underlying collection.
fun count(query: NativeBSON): Int import set_mongoc_error `{
bson_error_t error;
int64_t count = mongoc_collection_count(self, MONGOC_QUERY_NONE, query, 0, 0, NULL, &error);
if(count < 0) {
NativeMongoCollection_set_mongoc_error(self, &error);
return -1;
}
return count;
`}
lib/mongodb/native_mongodb.nit:414,2--425,3