mongodb :: NativeMongoCollection :: find
# Wrapper for `mongoc_collection_find()`.
#
# This function shall execute a `query` on the underlying collection.
#
# If no options are necessary, `query` can simply contain a query such as `{a:1}`.
#
# If you would like to specify options such as a sort order,
# the query must be placed inside of `{"$query": {}}`.
fun find(query: NativeBSON, skip, limit: Int): nullable NativeMongoCursor import
NativeMongoCursor.as nullable, set_mongoc_error `{
bson_error_t error;
mongoc_cursor_t *cursor;
cursor = mongoc_collection_find(self, MONGOC_QUERY_NONE, skip, limit, 0, query, NULL, NULL);
if (mongoc_cursor_error(cursor, &error)) {
NativeMongoCollection_set_mongoc_error(self, &error);
return null_NativeMongoCursor();
}
return NativeMongoCursor_as_nullable(cursor);
`}
lib/mongodb/native_mongodb.nit:427,2--445,3