SYNOPSIS

#include <bson.h>

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

DESCRIPTION

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

This can be useful in conjunction with qsort().

If equal, 0 is returned.

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

RETURN VALUE

0 if equal, otherwise -1 or 1 depending on memcmp().

ERRORS

No errors are defined.

AUTHORS

This page was written by MongoDB, Inc.