MONGOC_DATABAS...LLECTION_NAMES(3)
π MONGOC_DATABAS...LLECTION_NAMES(3) π
okay bestie sit down because we're talking about mongoc_database_get_collection_names(), and she comes from libmongoc π (yes the whole manual is filed under MONGOC_DATABAS...LLECTION_NAMES(3), the name is just a little long, she's dramatic like that).
β οΈ WARNING β οΈ
Deprecated since version 1.9.0 π bestie she's retired, she's a legacy icon, she's on the shelf.
Use mongoc_database_get_collection_names_with_opts() instead. Periodt. That's the glow-up version.
β¨ SYNOPSIS β¨
char **
mongoc_database_get_collection_names (mongoc_database_t *database,
bson_error_t *error);
π DESCRIPTION π
She fetches a NULL terminated array of NULL-byte terminated char* strings, and those strings contain the names of all of the collections in database. Like, every single one, all the receipts, no cap π§
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 π«Ά
But listen: if retryreads is false in the URI (see mongoc_uri_t), the retry behavior does not apply. No retries, no safety net, she simply vibes with the consequences π
πΈ PARAMETERS πΈ
- database β A
mongoc_database_t. This is the database she's snooping through, main character energy only. - error β An optional location for a
bson_error_t, orNULL. Optional!! If you don't want to hear about it, she won't tell you π
π ERRORS π
Errors are propagated via the error parameter. So if something goes wrong, that's where it shows up β check your error, babe.
β RETURNS β
A NULL terminated array of NULL terminated char* strings β and heads up, you must free it with bson_strfreev(). Clean up after yourself, we don't leave mess π
Upon failure, NULL is returned and error is set. That's the "it's giving nothing" outcome. π
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
and that's the whole page, bestie π this was libmongoc version 1.30.13, dated Oct 09 (the year got cut off in the footer, she's mysterious like that π), and the manual page sign-off is MONGOC_DATABAS...LLECTION_NAMES(3) because of course it is. stay hydrated, free your arrays, mwah πβ¨π¦
π¦ 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