Skip to content

Conversation

acondolu
Copy link

@acondolu acondolu commented May 10, 2024

This PR adds sizeOfDocument function, that computes the size in bytes of a BSON document without having to serialise it to binary format.

I wrote it for mongodb project, where MongoDB bulk insertion needs to estimate the size of the documents to be inserted before serialising them (trying to remain under the MongoDB maximum query limit).

I also tried to add a QuickCheck test, but I'm not sure it's working as expected... I tried to tweak the QuickCheck options to avoid huge arbitrary generated documents, but I'm not sure that's the right approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant