DOKK / manpages / debian 10 / libbson-doc / bson_new_from_data.3.en
BSON_NEW_FROM_DATA(3) Libbson BSON_NEW_FROM_DATA(3)

bson_new_from_data - bson_new_from_data()

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


  • data: A BSON encoded document buffer.
  • length: The length of data in bytes.

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.

A newly allocated bson_t if successful, otherwise NULL.

MongoDB, Inc

2017-present, MongoDB, Inc

February 23, 2019 1.14.0