MONGOC_BULKWRI...PTS_SET_UPSERT(3)

πŸ’… MONGOC_BULKWRI...PTS_SET_UPSERT(3) πŸ’…

okay bestie, welcome to the libmongoc manual page for mongoc_bulkwrite_updatemanyopts_set_upsert β€” it's giving tiny setter, big upsert energy ✨

✨ SYNOPSIS ✨

void
mongoc_bulkwrite_updatemanyopts_set_upsert (mongoc_bulkwrite_updatemanyopts_t *self, bool upsert);

πŸ’– DESCRIPTION πŸ’–

So you've got your mongoc_bulkwrite_updatemanyopts_t *self and you're setting the upsert bool. If upsert is true, then a new document gets created if no document matches the query. Slay. That's the whole vibe.

🫢 Important little note: the upsert option is not sent if this function is not called. And the server's default value is false. So no call = no upsert option sent, and the server falls back to false. iykyk.

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc

2009-present, MongoDB, Inc.


xoxo πŸ’‹ β€” this was libmongoc version 2.5.6, dated Oct 09, 202 🌸

πŸ“¦ where this page comes from