DOKK / manpages / debian 12 / libbson-doc / bson_compare.3.en
BSON_COMPARE(3) libbson BSON_COMPARE(3)

bson_compare - bson_compare()

int
bson_compare (const bson_t *bson, const bson_t *other);


  • bson: A bson_t.
  • other: A bson_t.

The bson_compare() function shall compare two bson documents for equality.

This can be useful in conjunction with _qsort()_.

If equal, 0 is returned.

TIP:

This function uses _memcmp()_ internally, so the semantics are the same.


less than zero, zero, or greater than zero in qsort() style.

MongoDB, Inc

2017-present, MongoDB, Inc

October 20, 2022 1.23.1