Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1328

db.collection.getShardDistribution() should give a warning rather than report collection is not sharded

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      Running db.collection.getShardDistribution() directly on a shard primary reports Collection X.Y is not sharded. even though it is. Running via a mongos correctly reports shard information.

      I think when running directly on a node, Mongo shell should instead respond "This command should be run via a mongos" or "Please connect to a mongos before calling this function"

            Assignee:
            Unassigned Unassigned
            Reporter:
            nicholas.cottrell@mongodb.com Nic Cottrell
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: