MONGOC_FIND_AN..._OPTS_GET_SORT(3)

✨ MONGOC_FIND_AN..._OPTS_GET_SORT(3) ✨

Okay so this is the MONGOC_FIND_AN..._OPTS_GET_SORT(3) page from libmongoc, and it’s literally the getter for the sort document on your find-and-modify options. Short, sweet, no cap. πŸŽ€


🌸 SYNOPSIS 🌸

void
mongoc_find_and_modify_opts_get_sort (const mongoc_find_and_modify_opts_t *opts,
                                      bson_t *sort);

🫢 PARAMETERS 🫢

  • opts β€” A mongoc_find_and_modify_opts_t. That’s the options object you’re pulling the sort from, bestie.
  • sort β€” An uninitialized bson_t. Yeah, uninitialized β€” don’t come in thinking it’s already set up. πŸ’…

πŸ’– DESCRIPTION πŸ’–

This function copies the sort document that was set with mongoc_find_and_modify_opts_set_sort(), or it initializes sort with an empty BSON document. That’s it. That’s the whole vibe. ✨

So if a sort document was previously set, you get a copy of it in sort; if not, sort gets initialized as an empty BSON document. Either way, sort is a properly initialized bson_t after the call. πŸ¦‹

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc

2009-present, MongoDB, Inc.


Periodt. That’s the whole page. Take the empty-BSON fallback as a gift and go slay your query. πŸ’…βœ¨

Big sparkly goodbye from libmongoc version 2.5.6, dated Oct 09, 202 β€” mwah πŸ’‹πŸŒΈ

πŸ“¦ where this page comes from