GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
MONGOC_COLLECTION_FIND_AND_MODIFY_WITH_OPTS(3) libmongoc MONGOC_COLLECTION_FIND_AND_MODIFY_WITH_OPTS(3)

bool
mongoc_collection_find_and_modify_with_opts (

mongoc_collection_t *collection,
const bson_t *query,
const mongoc_find_and_modify_opts_t *opts,
bson_t *reply,
bson_error_t *error);


  • collection: A mongoc_collection_t.
  • query: A bson_t containing the query to locate target document(s).
  • opts: A find and modify options. Must not be NULL.
  • reply: A maybe-NULL pointer to overwritable storage for a bson_t to contain the results.
  • error: An optional location for a bson_error_t or NULL.

Update and return an object.

reply is always initialized, and must be freed with bson_destroy().

If an unacknowledged write concern is set (through mongoc_find_and_modify_opts_append()), the output reply is always an empty document.

On success, the output reply contains the full server reply to the findAndModify command. See the MongoDB Manual page for findAndModify for the expected server reply.

Errors are propagated via the error parameter.

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

A write concern timeout or write concern error is considered a failure.

See the example code for mongoc_find_and_modify_opts_t.

MongoDB, Inc

2009-present, MongoDB, Inc.

July 3, 2025 1.30.4

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.