MONGOC_DATABAS...ND_COLLECTIONS(3)
π mongoc_database_find_collections π
okay bestie, we're in the libmongoc manual, and today's main character is mongoc_database_find_collections β a real one, even if it's, um, a little vintage now. π«Ά
β οΈ WARNING β οΈ
Deprecated since version 1.9.0: use mongoc_database_find_collections_with_opts() instead. π
no cap, this one is in its retired era. she still works, but the glow-up version is mongoc_database_find_collections_with_opts(). go text her. π
β¨ SYNOPSIS β¨
mongoc_cursor_t *
mongoc_database_find_collections (mongoc_database_t *database,
const bson_t *filter,
bson_error_t *error);
πΈ DESCRIPTION πΈ
She fetches a cursor stuffed with documents, and each one of those documents corresponds to a collection on this database. like, one doc per collection, periodt. π
This function is considered a retryable read operation. so if a transient error happens β think a network error, errors due to replica set failover, etc. β the operation is safely retried once. iconic resilience honestly. π
BUT. if retryreads is false in the URI (see mongoc_uri_t), the retry behavior does not apply. so, y'know, vibe check your URI first. π
π¦ PARAMETERS π¦
- database β a
mongoc_database_t. the database we're snooping through. π - filter β a matcher used by the server to filter the returned collections. May be
NULL. no filter, no problem, she'll show you everything. - error β an optional location for a
bson_error_t, orNULL. your little oopsie-daisy inbox. π
π ERRORS π
Errors are propagated via the error parameter. that's the whole tea. if something goes sideways, it lands in your bson_error_t. β
π RETURNS π
This function returns a newly allocated mongoc_cursor_t that should be freed with mongoc_cursor_destroy() when no longer in use, or NULL in case of error. β¨
β οΈ bestie, listen: the user must callmongoc_cursor_next()on the returnedmongoc_cursor_tto execute the initial command. she does not run on her own. you gotta poke her. π«΅
In the returned cursor, each result corresponds to the server's representation of a collection in this database. so like, what the server says a collection is β not your parasocial idea of it. π
And a lil heads-up: the cursor functions mongoc_cursor_set_limit(), mongoc_cursor_set_batch_size(), and mongoc_cursor_set_max_await_time_ms() have no use on the returned cursor. don't bother, they're giving nothing here. π«
π§ AUTHOR π§
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
and that's the whole page, babe. this was libmongoc version 1.30.13, dated Oct 09, 202β¦ π mwah, go free your cursors and hydrate. π
π¦ where this page comes from
- fedora 43: mongo-c-driver-devel 1.30.13-1.fc43 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- fedora 43: mongo-c-driver-devel 1.30.13-1.fc43 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms