Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-661

DBCollection.count returns long, DBCursor.count truncates to int

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor - P4 Minor - P4
    • None
    • 2.8.0, 2.9.0, 2.9.1
    • API, Command Operations
    • None
    • Major Change

    Description

      Similar to CSHARP-254.

      Mongo does not limit the number of document to 2^32, so DBCollection has it right. DBCursor defers to the same server command, so there's no good reason to return something different here beyond not breaking code written against DBCursor.count. Currently, count on a cursor over a very large collection will truncate, which isn't great.

      Adding this detail as a separate issue so that the fix can be included in some release where forcing some client-app cleanup is ok.

      Attachments

        Activity

          People

            Unassigned Unassigned
            matt.schemmel Matt Schemmel
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: