-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 3.4.0
-
Component/s: Aggregation Framework
-
Fully Compatible
-
Query 2017-07-10
-
0
$collStats has useful information when run on a mongod, but it's less useful when run on a mongos:
shards: { "_id" : "shard0000", "host" : "celadon:20000", "state" : 1 } { "_id" : "shard0001", "host" : "celadon:20001", "state" : 1 } databases: { "_id" : "test", "primary" : "shard0000", "partitioned" : true } test.coll shard key: { "_id" : "hashed" } unique: false balancing: true chunks: shard0000 2 shard0001 3
mongos> db.coll.aggregate([{$collStats: {}}]) { "ns" : "test.coll", "localTime" : ISODate("2017-04-26T14:18:29.066Z") } { "ns" : "test.coll", "localTime" : ISODate("2017-04-26T14:18:29.074Z") }
It would be useful if the result could also include information that identifies which mongod or which shard is associated with each result (for example, hostname and port).
- related to
-
SERVER-29546 Add hostname to standard $currentOp output, and include shard name when run on a cluster
- Closed