MONGOC_BULK_O...MANY_WITH_OPTS(3)

πŸ’… MONGOC_BULK_O...MANY_WITH_OPTS(3) πŸ’…

okay so bestie, welcome to the glow-up of mongoc_bulk_operation_remove_many_with_opts πŸ’– this is straight out of the libmongoc manual (that's the manual name, periodt), and it's the function you call when you wanna yeet a whole bunch of docs into the deletion queue 🌸


✨ SYNOPSIS ✨

bool
mongoc_bulk_operation_remove_many_with_opts (mongoc_bulk_operation_t *bulk,
                                             const bson_t *selector,
                                             const bson_t *opts,
                                             bson_error_t *error); /* OUT */

So what it does: it deletes documents as part of a bulk operation 🫢 but like… heads up, it only queues the operation, it does NOT run it. To actually execute, you gotta call mongoc_bulk_operation_execute(). No cap, queuing β‰  executing πŸ’€


πŸŽ€ PARAMETERS πŸŽ€

  • bulk β€” a mongoc_bulk_operation_t. your main character bulk operation ✨
  • selector β€” a bson_t that selects which document to remove πŸ‘‘ (yes, "document" singular in the original, we don't make the rules, we just deliver them)
  • error β€” an optional location for a bson_error_t, or NULL πŸ™ˆ if you're feeling brave

opts may be NULL or a BSON document with extra command options, and those options are: πŸ¦‹

  • collation β€” configure textual comparisons. see Setting Collation Order, and the MongoDB Manual entry on Collation πŸ“– collation requires MongoDB 3.2 or later, otherwise an error is returned ⚠️
  • hint β€” a document or string that specifies the index to use to support the query predicate 🧚

πŸ’€ ERRORS πŸ’€

okay so, two totally different lanes here: operation errors are propagated via mongoc_bulk_operation_execute() 🌈 while argument validation errors are reported by the error argument. different channels, different vibes, don't mix 'em up 😭


⭐ RETURNS ⭐

returns true on success πŸŽ‰ and false if passed invalid arguments πŸ’… that's it, that's the return value.

πŸ‘€ SEE ALSO

  • mongoc_bulk_operation_remove()
  • mongoc_bulk_operation_remove_one_with_opts()

🌸 AUTHOR 🌸

MongoDB, Inc πŸ‘‘

2009-present, MongoDB, Inc.


and that's the whole page bestie, slay πŸ’…βœ¨ version 2.5.6, dated Oct 09, 2026 β€” go forth and delete responsibly πŸŽ€πŸ¦‹πŸ”₯

πŸ“¦ where this page comes from