bson_new_from_data - Man Page

Synopsis

bson_t *
bson_new_from_data (const uint8_t *data, size_t length);

Parameters

Description

The bson_new_from_data() <> function shall create a new bson_t <> on the heap and copy the contents of data. This may be helpful when working with language bindings but is generally expected to be slower.

It is an error if length does not match the length embedded in the first four bytes of the BSON data in data.

Returns

A newly allocated bson_t <> if successful, otherwise NULL.

Author

MongoDB, Inc

Info

Jun 12, 2026 2.3.1 libbson