MONGOC_DATABASE_ADD_USER(3)
π MONGOC_DATABASE_ADD_USER(3) π
okay bestie, welcome to the MONGOC_DATABASE_ADD_USER(3) page from libmongoc β¨ this is the little API that shall create a new user with access to a database, and we are gonna go through every detail together. no cap, it's giving βshort but importantβ energy π
β¨ SYNOPSIS β¨
bool
mongoc_database_add_user (mongoc_database_t *database,
const char *username,
const char *password,
const bson_t *roles,
const bson_t *custom_data,
bson_error_t *error);
π PARAMETERS π
databaseβ Amongoc_database_t. this is the database bestie we're adding the user to πusernameβ The name of the user. yes, the actual username, iconic behavior β¨passwordβ The cleartext password for the user. it's literally cleartext, so keep that in mind πrolesβ An optionalbson_tfor roles. optional, but if you need roles, this is where they go πcustom_dataβ An optionalbson_tfor extra data. cute little bonus info slot π¦errorβ A location for abson_error_torNULL. this is where the tea gets reported if something goes wrong π
This function shall create a new user with access to database. periodt. π
WARNING: Do not call this function without TLS. fr fr, this is not the vibe to ignore π¨
π ERRORS π
Errors are returned through the error parameter and can include socket or other server side failures. so like, if the network is being messy or the server side is throwing a fit, that's the kind of thing that can show up here π
π RETURNS π
Returns true if the user was successfully added. Returns false and sets error if there are invalid arguments or a server or network error. straightforward, but still important, iykyk π
π AUTHOR π
MongoDB, Inc β yes, that MongoDB, Inc π
π COPYRIGHT π
2009-present, MongoDB, Inc. β protect the copyright, bestie π«Ά
xoxo, this has been MONGOC_DATABASE_ADD_USER(3) from libmongoc, version 2.5.6, dated Oct 09, 2026 β go add those users safely, and remember the TLS warning, okay? πβ¨π
π¦ 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