BugZero found this defect 318 days ago.
Data sources
All data on this page is proprietary to BugZero® or gathered from public sources
3/14/2024
MongoDB Server
No affected releases provided.
No fixed releases provided.
Output of the collStats command includes a boolean field sharded, which is true is the collection is sharded, and false otherwise. $collStats aggregation, that should be used instead of the deprecated collStats command does not include this field. Some products, including Mongoid and Doctrine ODMs relies on this field to detect whether a collection is sharded. We should have this field in the output of $collStats aggregation.
Connect to a cluster using mongosh, and execute the following commands to confirm the issue: Enterprise [mongos] test> db.runCommand({collStats: 'users'}) { sharded: false, // Full output omitted } Enterprise [mongos] test> db.users.aggregate([{$collStats: {}}]) [ { ns: 'test.users', shard: 'shard01', host: 'iceberg:27019', localTime: ISODate("2023-07-06T15:42:43.880Z") } ] Enterprise [mongos] test> var resp = db.users.aggregate([{$collStats: {storageStats: {}}}]).next();Enterprise [mongos] test> Object.keys(resp); [ 'ns', 'shard', 'host', 'localTime', 'storageStats' ] Enterprise [mongos] test> Object.keys(resp['storageStats']); [ 'size', 'count', 'avgObjSize', 'numOrphanDocs', 'storageSize', 'freeStorageSize', 'capped', 'wiredTiger', 'nindexes', 'indexDetails', 'indexBuilds', 'totalIndexSize', 'indexSizes', 'totalSize', 'scaleFactor' ]