I'm searching for a way to copy a BSON document to a buffer or into a file using the C-library libbson.
I think I'm missing something - any help is appreciated.
bson_as_canonical_extended_json exports BSON into UTF-8 without loss of information.
If you only need buffer data, you can use bson_get_data :
bson_t * bson = bson_new(); ///// Fill with data // Get data buffer const char * data = reinterpret_cast<const char*>(bson_get_data(bson)); int length = bson->len;
Copyright © 2021 Jogjafile Inc.
bson_as_canonical_extended_json exports BSON into UTF-8 without loss of information.