[DOCS-10449] Docs for SERVER-28978: Add hostname to $collStats output, and include shard name when run on a cluster Created: 27/Jun/17  Updated: 29/Oct/23  Resolved: 11/Oct/17

Status: Closed
Project: Documentation
Component/s: Server
Affects Version/s: None
Fix Version/s: 3.5.10

Type: Task Priority: Major - P3
Reporter: Emily Hall Assignee: Jonathan DeStefano
Resolution: Fixed Votes: 0
Labels: aggregation, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-28978 Add hostname to $collStats output, an... Closed
Participants:
Days since reply: 6 years, 18 weeks ago
Epic Link: DOCS: 3.6 Server

 Description   

Documentation Request Summary:

The output format section of the $collStats documentation will need to note that the shardname and hostname are now displayed between the 'ns' and 'localTime' fields of the returned document. While the hostname will always be present, the shard name will be omitted if the mongoD is not part of a cluster.

Engineering Ticket Description:

$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).



 Comments   
Comment by Githook User [ 12/Oct/17 ]

Author:

{'email': 'jonathan.destefano@10gen.com', 'name': 'jonathan', 'username': 'jdestefano-mongo'}

Message: DOCS-10449 - Added shard and host to collStats.

Signed-off-by: kay <kay.kim@10gen.com>
Branch: master
https://github.com/mongodb/docs/commit/e18d37cd083a664a1cc5fe74a223161f3ed19f7a

Generated at Thu Feb 08 08:00:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.