Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-839

Count method on cursor returns value decreased by one

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.2.5
    • Component/s: MongoDB 3.2
    • Labels:
    • Environment:
      Mac OS 10.11.2. MongoDB 3.2.6. Node js v 4.4.4

      I have error when trying to count documents in collection

      In source collection i two documents

      My query:
      sourceCollection.find({}).limit(1000).skip(0).count(true, function(err, count)

      { //In here error = null; count = 1 <-- ??? but should be two. }

      );

      Same issue when i have single document.

      Count somehow return result -1 instead of just result.

      Here is screen shots of
      collection - https://gyazo.com/d3548f2ab1d332d39030751d95065a92
      Query and output - https://gyazo.com/dfe6157b8443de016fb97e9b469248d2

            Assignee:
            Unassigned Unassigned
            Reporter:
            Mukolajko Mykola Borysiuk [X]
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: