MONGOC_CLIENT_...ASES_WITH_OPTS(3)
π
mongoc_client_find_databases_with_opts π
okay so bestie, this is a libmongoc manual page, and it's lowkey giving βlist every database on this MongoDB serverβ energy. no cap, letβs get into it. π¦
β¨ SYNOPSIS β¨
mongoc_cursor_t *
mongoc_client_find_databases_with_opts (
mongoc_client_t *client, const bson_t *opts);
This function fetches a cursor containing documents, and each document corresponds to a database on this MongoDB server. π«Ά
Itβs considered a retryable read operation, periodt. If a transient error happens (a network error, errors due to replica set failover, etc.), the operation is safely retried once. If retryreads is false in the URI (see mongoc_uri_t), then the retry behavior does not apply. π
πΈ PARAMETERS πΈ
clientβ amongoc_client_t. the main character client. β¨optsβ abson_tcontaining additional options.
opts may be NULL or a BSON document with additional command options: π
sessionIdβ first, construct amongoc_client_session_twithmongoc_client_start_session(). You can begin a transaction withmongoc_client_session_start_transaction(), optionally with amongoc_transaction_opt_tthat overrides the options inherited fromclient, and usemongoc_client_session_append()to add the session toopts. See the example code formongoc_client_session_t. πserverIdβ to target a specific server, include an int32"serverId"field. Obtain the id by callingmongoc_client_select_server(), thenmongoc_server_description_id()on its return value. π₯
For a list of all options, see the MongoDB Manual entry on the listDatabases command. π
π ERRORS π
Use mongoc_cursor_error() on the returned cursor to check for errors. thatβs the vibe check, bestie.
π RETURNS π
A cursor where each result corresponds to the server's representation of a database. π
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. like, none. π
π§ AUTHOR π§
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
mwah π this page is from libmongoc 2.5.6, dated Oct 09, 202 β k bye bestie, go fetch those databases! π
π¦ where this page comes from
- epel 10: mongo-c-driver-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms