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

Count method on cursor returns value decreased by one

    XMLWordPrintable

    Details

    • Type: Question
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.2.5
    • Fix Version/s: None
    • Component/s: MongoDB 3.2
    • Labels:
      None
    • Environment:
      Mac OS 10.11.2. MongoDB 3.2.6. Node js v 4.4.4

      Description

      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

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: