[DOCS-9217] Example output of listShards command Created: 26/Oct/16  Updated: 30/Oct/23  Resolved: 16/Oct/17

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Minor - P4
Reporter: Luke Lovett Assignee: Nicholas Larew
Resolution: Done Votes: 0
Labels: sharding
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 6 years, 17 weeks, 2 days ago
Story Points: 0.2

 Description   

https://docs.mongodb.com/manual/reference/command/listShards/

Although page provides example usage of the listShards command, it doesn't provide any details on what is actually returned. It merely states that the command "returns a list of shards." What does a shard look like, in the context of the command?

It would be helpful to see some example output like what's on this page: https://docs.mongodb.com/manual/reference/command/isdbgrid/#dbcmd.isdbgrid

Here's the output of the command on my local machine. Three shards, each a standalone mongod:

{
        "shards" : [
                {
                        "_id" : "4a0f71de-e0e1-42da-86ee-4a70ebdeae8a",
                        "host" : "localhost:1028",
                        "state" : 1
                },
                {
                        "_id" : "7c3da9c7-5a49-4539-bc9b-3343e8984ecf",
                        "host" : "localhost:1029",
                        "state" : 1
                },
                {
                        "_id" : "7fce9155-6c41-4cc3-9c54-477330d49c56",
                        "host" : "localhost:1030",
                        "state" : 1
                }
        ],
        "ok" : 1
}



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

Author:

{'email': 'nick.larew@10gen.com', 'name': 'Nick Larew', 'username': 'nlarew'}

Message: DOCS-9217: Added example output and explanation for listShards admin command

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

Generated at Thu Feb 08 07:57:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.