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

coll.stats() may fail with result.shards is not iterable

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 0.12.1
    • Affects Version/s: None
    • Component/s: Shell API
    • None
    • Iteration Athens, Iteration Barcelona
    • Not Needed

      See https://mongodb.slack.com/archives/CUKTSEB6J/p1611763429004100?thread_ts=1611762413.002900&cid=CUKTSEB6J – I would guess that this refers to https://github.com/mongodb-js/mongosh/blob/fb80fdea897dc48766c80058ddfae203f0e71f0b/packages/shell-api/src/collection.ts#L1395, result.shards can be a non-iterable even though result.sharded is true?

      https://docs.mongodb.com/manual/reference/command/collStats/ doesn’t mention either property, but they are present in sharded setups, so I’m not sure whether this is a server bug or purely a shell problem.

            Assignee:
            anna.henningsen@mongodb.com Anna Henningsen
            Reporter:
            anna.henningsen@mongodb.com Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: