MONGOC_CLIENT_COMMAND_SIMPLE(3)

πŸ’… MONGOC_CLIENT_COMMAND_SIMPLE(3) πŸ’…

okay so bestie, welcome to the libmongoc manual, page MONGOC_CLIENT_COMMAND_SIMPLE(3) β€” this is the one where you run a command on the client, simple-style. ✨

✨ SYNOPSIS ✨

bool
mongoc_client_command_simple (mongoc_client_t *client,
                              const char *db_name,
                              const bson_t *command,
                              const mongoc_read_prefs_t *read_prefs,
                              bson_t *reply,
                              bson_error_t *error);

quick heads up: the client's read preference, read concern, and write concern are not applied to the command. like, none of them. not even a little. 🫢

WARNING: reply is always set, and it should be released with bson_destroy(). always. no cap. 😭

also, this function is not considered a retryable read operation. periodt. πŸ’…


πŸŽ€ PARAMETERS πŸŽ€

  • client β€” a mongoc_client_t. your client. your main character. πŸ‘‘
  • db_name β€” the name of the database you wanna run the command on. πŸ“
  • command β€” a bson_t holding the command specification. the actual vibe of the command lives here. ✨
  • read_prefs β€” an optional mongoc_read_prefs_t. if you don't give one, the command uses mode MONGOC_READ_PRIMARY. πŸ’–
  • reply β€” a maybe-NULL pointer to overwritable storage for a bson_t to contain the results. overwritable fr fr. πŸ¦‹
  • error β€” an optional location for a bson_error_t, or NULL if you're feeling brave. πŸ™ˆ

πŸ’€ ERRORS πŸ’€

errors are propagated via the error parameter. that's the whole story, bestie β€” that's where they go. 😌


🌈 RETURNS 🌈

returns true if successful. returns false and sets error if there are invalid arguments or a server or network error. 😭

also important: this function does not check the server response for a write concern error or write concern timeout. so don't come for it when it doesn't flag those β€” it literally never looked. πŸ’€

πŸ’œ AUTHOR πŸ’œ

MongoDB, Inc. iconic. πŸ‘‘

2009-present, MongoDB, Inc. πŸŽ€


so yeah, that's the whole page, mwah πŸ’‹ β€” this was libmongoc 2.5.6, dated Oct 09, 2026, and the page is MONGOC_CLIENT_COMMAND_SIMPLE(3). go forth and command things, bestie 🫢✨

πŸ“¦ where this page comes from