Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing and reading BSON data #1368

Closed
snirgaz opened this issue Nov 22, 2018 · 2 comments
Closed

Writing and reading BSON data #1368

snirgaz opened this issue Nov 22, 2018 · 2 comments

Comments

@snirgaz
Copy link

snirgaz commented Nov 22, 2018

I would like to read and write my data to a file using the BSON format.
It would be nice to have an example explaining how to achieve that.

The conversion to BSON format is explained very cleary,
std::vector<std::uint8_t> v_bson = json::to_bson(j);
What is less clear (atleast to me) is how to write (and subsequently read) v_bson to a binary file while maintaining compatability with the BSON file format allowing it to be read by python e.g.

@nlohmann
Copy link
Owner

Here is the documentation of the relevant functions:

Do you need more information?

@snirgaz
Copy link
Author

snirgaz commented Nov 22, 2018

Thanks for pointing me in the right direction!

@snirgaz snirgaz closed this as completed Nov 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants