-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Embedded Shell
-
None
-
3
-
Iteration Xochimilco, Iteration Zanzibar, Iteration Anemone
-
Not Needed
Slack thread: https://mongodb.slack.com/archives/CUHC9R8J0/p1644801758947139
Hello Team, Is it expected to see the difference between mongo and mongosh in terms of how the size is calculated? it looks like that mongo defines GB as 1,073,741,824 byte, and mongosh defines GB 1,000,000,000 byte[ec2-user@ip-10-0-0-161 ~]$ mongo --version
MongoDB shell version v5.0.6[ec2-user@ip-10-0-0-161 ~]$ mongosh --version
1.1.9 * mongosh(defines GB 1,000,000,000 byte)
- mongos
Enterprise [direct: mongos] test> show dbs
test 2.3 GB
MongoDB Enterprise mongos> db.stats().totalSize
NumberLong("2299686912") - Shard1
Enterprise myReplicaSet2 [direct: primary] test> show dbs
test 676 MB
Enterprise myReplicaSet2 [direct: primary] test> db.stats().totalSize
675983360 - Shard2
Enterprise myReplicaSet2_1 [direct: primary] test> show dbs
test 1.62 GB
Enterprise myReplicaSet2_1 [direct: primary] test> db.stats().totalSize
1623703552 * mongo (defines GB as 1,073,741,824 byte)
- mongos
MongoDB Enterprise mongos> show dbs
test 2.142GB
MongoDB Enterprise mongos> db.stats().totalSize
NumberLong("2299686912")
MongoDB Enterprise mongos> - Shard1
MongoDB Enterprise myReplicaSet2:PRIMARY> show dbs
test 0.630GB
MongoDB Enterprise myReplicaSet2:PRIMARY> db.stats().totalSize
675983360 - Shard2
MongoDB Enterprise myReplicaSet2_1:PRIMARY> show dbs
test 1.512GB
MongoDB Enterprise myReplicaSet2_1:PRIMARY> db.stats().totalSize
1623703552 (edited)