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, or NULL. 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


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