MONGOC_COLLECTION_REMOVE(3)
π MONGOC_COLLECTION_REMOVE(3) π
okay bestie, welcome to MONGOC_COLLECTION_REMOVE(3) from the libmongoc manual β this is the one that goes yeet on documents in your collection ποΈβ¨
πΈ SYNOPSIS πΈ
Like, here's the whole vibe in code form, no cap:
bool
mongoc_collection_remove (mongoc_collection_t *collection,
mongoc_remove_flags_t flags,
const bson_t *selector,
const mongoc_write_concern_t *write_concern,
bson_error_t *error);
It's giving "returns a bool, takes five things." Iconic. π«Ά
π PARAMETERS π
collectionβ amongoc_collection_t. the collection in question, the main character, the one whose documents are about to be gone πflagsβ amongoc_remove_flags_t. this is where you drop stuff like the single-remove flag (more on that below π)selectorβ abson_tcontaining the query to match documents. basically "who's getting deleted" β¨write_concernβ amongoc_write_concern_t, orNULL. your call, queen πerrorβ an optional location for abson_error_t, orNULL. optional!! don't stress π
β¨ DESCRIPTION β¨
NOTE: π¨ if you wanna pass additional options, usemongoc_collection_delete_one()ormongoc_collection_delete_many()instead. that's the glow-up path, bestie.
So this function shall remove documents in the given collection that match selector. lowkey it's that simple π
Here's the tea though β the bson selector is not validated. it just gets passed along as appropriate to the server. so compatibility and errors should be validated in the appropriate server documentation. fr fr, server docs are your bestie here π§
And if you want to limit deletes to a single document, just provide MONGOC_REMOVE_SINGLE_REMOVE in flags. one doc, one delete, very demure π
π ERRORS π
Errors are propagated via the error parameter. that's it, that's the whole section. mwah π
π¦ RETURNS π¦
Returns true if successful. β¨slayβ¨
Returns false and sets error if there are invalid arguments, or a server or network error. not the vibe, but at least you'll know why π
π AUTHOR π
MongoDB, Inc β the icons themselves.
π COPYRIGHT π
2009-present, MongoDB, Inc.
and that's the page!! written to you with love by libmongoc version 2.5.6, dated Oct 09, 2026, straight from the MONGOC_COLLECTION_REMOVE(3) manual β stay hydrated, validate your selectors, and go delete responsibly bestie π
π
π¦ 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