+ 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);
+ `}
+
+ # Wrapper for `mongoc_collection_aggregate()`.
+ #
+ # This function shall execute an aggregation `pipeline` on the underlying collection.
+ #
+ # The `pipeline` parameter should contain a field named `pipeline` containing
+ # a BSON array of pipeline stages.
+ fun aggregate(pipeline: NativeBSON): nullable NativeMongoCursor import