---
name: "bson_oid_init_sequence"
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_init_sequence"
---

# bson\_oid\_init\_sequence(3)

**WARNING:**

Deprecated since version 1.14.0: Use *bson\_oid\_init()* instead.

## SYNOPSIS

```
void
bson_oid_init_sequence (bson_oid_t *oid, bson_context_t *context);
```

## PARAMETERS

- •

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

- •

  **context**: An optional *bson\_context\_t*.

## DESCRIPTION

Generates a new ObjectID with the next 64-bit sequence number in **context**. The first 4 bytes contain the current time and the following 8 contain the sequence number in big-endian format.

The *bson\_oid\_t* generated by this function is not guaranteed to be globally unique. Only unique within this context. It is however, guaranteed to be sequential.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
