Object.bsonsize() returns invalid value (> 16MB)
Solved
On our database, when using
Object.bsonsize(...)
return result are more than 16MB (which is the limit of Mongo) for document closed to 16MB.
On native mongo shell, the result is correct.
The command used is
Object.bsonsize(db.somecollection.findOne({_id: ObjectId("5cf4ad28e4b01b4f149171ad")}))on Mongo Shell (and many other utilities), the outcome is 16358953 but in NoSQLBooster (5.1.8), the outcome is 30159454.
Resolved in 5.1.0
Resolved in 5.1.0
By the way, the function calculateObjectSize() has the same problem - probably underline code is the same.
By the way, the function calculateObjectSize() has the same problem - probably underline code is the same.
I created a document of about 16M (16774947), tried it a few times, and couldn't reproduce your issue. If you're reporting a bug, please make sure you include steps to reproduce it.
I created a document of about 16M (16774947), tried it a few times, and couldn't reproduce your issue. If you're reporting a bug, please make sure you include steps to reproduce it.
As mentioned in the original report, version of NoSQLBooster is 5.18. Here are other information
As mentioned in the original report, version of NoSQLBooster is 5.18. Here are other information
OK, the key here is the reproduction step of bug, without which it is difficult to solve the problem by guessing.
We use the following script to create a big document, It's close to 16m in size. I tried a few times, but can't recall this issue.
OK, the key here is the reproduction step of bug, without which it is difficult to solve the problem by guessing.
We use the following script to create a big document, It's close to 16m in size. I tried a few times, but can't recall this issue.
this can be reproduced:
1. download a more complicate JSON file, for example, like this one https://data.cdc.gov/api/views/bi63-dtpu/rows.json?accessType=DOWNLOAD
2. replicate the data to 71000 rows - this will make the bson size to be around 15mb
3. using mongoimport to import this JSON file
Here is the result from mongo shell
mongos> Object.bsonsize(db.testSize.findOne({_id:ObjectId("5cfefa9ed8ea4d9d536d29d7")}))
15692505
however, in NoSQLBooster, it returns "22704873" which clearly violate the limitation (16mb)
this can be reproduced:
1. download a more complicate JSON file, for example, like this one https://data.cdc.gov/api/views/bi63-dtpu/rows.json?accessType=DOWNLOAD
2. replicate the data to 71000 rows - this will make the bson size to be around 15mb
3. using mongoimport to import this JSON file
Here is the result from mongo shell
mongos> Object.bsonsize(db.testSize.findOne({_id:ObjectId("5cfefa9ed8ea4d9d536d29d7")}))
15692505
however, in NoSQLBooster, it returns "22704873" which clearly violate the limitation (16mb)
Thank you for your bug report.
We have worked out a new test build to resolve this issue, please download and give it a try.
MacOS: https://nosqlbooster.com/s3/download/releasesv5/nosqlbooster4mongo-5.1.9-beta.1.dmg
Thank you for your bug report.
We have worked out a new test build to resolve this issue, please download and give it a try.
MacOS: https://nosqlbooster.com/s3/download/releasesv5/nosqlbooster4mongo-5.1.9-beta.1.dmg
Thank you for the quick turn-around. I will test it out.
Thank you for the quick turn-around. I will test it out.
5.1.9beta1 works fine - this problem is no longer present.
5.1.9beta1 works fine - this problem is no longer present.
Resolved in 5.1.0
Resolved in 5.1.0
Replies have been locked on this page!