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

Calculating MongoDB max document size #47

Closed
mattcollier opened this issue May 20, 2019 · 1 comment
Closed

Calculating MongoDB max document size #47

mattcollier opened this issue May 20, 2019 · 1 comment

Comments

@mattcollier
Copy link
Contributor

Adding this information here so this issue can be referenced in code.

The MongoDB driver has to account for some data structure overhead when calculating the maximum document size, namely the size in bytes of the array indexes.

mongodb/node-mongodb-native@436cb84

https://jira.mongodb.org/browse/NODE-1778

https://github.com/mongodb/node-mongodb-native/blob/436cb84f06c1d71eac82eed2b0f1a301a9ab9b13/lib/bulk/ordered.js#L26

https://github.com/mongodb-js/bson-ext

https://github.com/mongodb/js-bson#calculateObjectSize

Max Size Formula
https://github.com/mongodb/node-mongodb-native/blob/436cb84f06c1d71eac82eed2b0f1a301a9ab9b13/lib/bulk/common.js#L700

@mattcollier
Copy link
Contributor Author

This is for historical reference.

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

No branches or pull requests

1 participant