---
name: "bson_oid_compare"
section: "3"
platform: "linux"
package: "libbson-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/bson_oid_compare"
---

# bson\_oid\_compare(3)

## SYNOPSIS

```
int
bson_oid_compare (const bson_oid_t *oid1, const bson_oid_t *oid2);
```

## PARAMETERS

- •

  **oid1**: A *bson\_oid\_t*.

- •

  **oid2**: A *bson\_oid\_t*.

## DESCRIPTION

The *bson\_oid\_compare()* function shall return a qsort() style value of a lexicographical sort of **oid1** and **oid2**.

## RETURNS

less than 0, 0, or greater than 0 based on the comparison.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
