Following SERVER-50756, there appears to be a problem with db.stats():
There are two ways to call the referenced stats:
db.runCommand({dbStats: 1, freeStorage: 1});
db.stats({freeStorage: 1})
In mongosh run:
test> db.stats({freeStorage: 1});
MongoServerError: scale has to be a number > 0
Expected:
Output similar to the runCommand call:
test> db.runCommand({dbStats: 1, freeStorage: 1});
{
db: 'test',
collections: 1,
views: 0,
objects: 1,
avgObjSize: 36,
dataSize: 36,
storageSize: 20480,
freeStorageSize: 0,
indexes: 1,
indexSize: 20480,
indexFreeStorageSize: 0,
totalSize: 40960,
totalFreeStorageSize: 0,
scaleFactor: 1,
fsUsedSize: 46888751104,
fsTotalSize: 62725623808,
ok: 1,
'$clusterTime': {
clusterTime: Timestamp(
{ t: 1642786653, i: 1 }
),
signature: {
hash: Binary(Buffer.from("0000000000000000000000000000000000000000", "hex"), 0),
keyId: Long("0")
}
},
operationTime: Timestamp({ t: 1642786653, i: 1 })
}