MONGOC_DATABASE_HAS_COLLECTION(3)
π MONGOC_DATABASE_HAS_COLLECTION(3) π
okay so this one is from the libmongoc manual, bestie, and it's literally the "does this collection exist?" check β¨
πΈ SYNOPSIS πΈ
bool
mongoc_database_has_collection (mongoc_database_t *database,
const char *name,
bson_error_t *error);
This function checks to see if a collection exists on the MongoDB server within database. It's giving collection vibe check, no cap π
π PARAMETERS π
databaseβ amongoc_database_t. That's the database we're looking inside π«Άnameβ a string containing the name of the collection. Like, the collection's name, periodt πerrorβ an optional location for abson_error_t, orNULL. You can pass a spot for it, or just passNULLif you don't want it πΈ
π ERRORS π
Errors are propagated via the error parameter. So if something goes sideways, it rides out through error, iykyk π
π RETURNS π
If the function succeeds, it returns true if the collection exists and false if not, and in either case the fields of error are cleared, if error is not NULL. Cleanup slay β¨
Returns false and sets error if there are invalid arguments or a server or network error. Not iconic, but that's the deal π
π AUTHOR π
MongoDB, Inc
π¦ COPYRIGHT π¦
2009-present, MongoDB, Inc.
later, bestie π«Ά this page is from libmongoc, version 2.5.6, dated Oct 09, 2026 π
π¦ 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