Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-9217

Example output of listShards command

    • 0.2

      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
      }
      

            Assignee:
            nick.larew@mongodb.com Nicholas Larew
            Reporter:
            luke.lovett Luke Lovett
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              6 years, 39 weeks, 5 days ago