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

mongosh does not provide a number using count() for large collection

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.0.6
    • Affects Version/s: 1.0.5
    • Component/s: Shell API
    • Environment:
      macOS 10.14.6
    • Needed
    • Hide

      count() in mongosh behaves differently compared with mongo.

      Show
      count() in mongosh behaves differently compared with mongo.
    • Iteration Johannesburg, Iteration Kampala

      Problem Statement/Rationale

      What is going wrong?

      mongosh doesn't return a count() value. To get the cursor back, must hit ctrl-C.

      mongo shell 4.4 works fine

      Running embedded mongosh inside Compass 1.28.1 increases CPU over 100%, and control doesn't return either.

      Steps to Reproduce

      How could an engineer replicate the issue you’re reporting?

      Collection has 6 million documents.

      See my COMPASS ticket created today

      Expected Results

      What do you expect to happen?

      See the count provided in mongo shell for same collection, 6555160.

      Actual Results

      What do you observe is happening?

      No value shown. Cursor is locked. Ctrl-C pressed to get cursor back.

      Additional Notes

      Any additional information that may be useful to include.

            Assignee:
            Unassigned Unassigned
            Reporter:
            felicia.hsieh@mongodb.com Felicia Hsieh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: