Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-8120

mongoexport and count command return different number of records

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major - P3 Major - P3
    • None
    • 2.0.4
    • Shell
    • None
    • Linux 64bit
      Linux 2.6.32-220.7.1.el6.x86_64 #1 SMP Wed Mar 7 00:52:02 GMT 2012 x
      86_64 x86_64 x86_64 GNU/Linux
    • Linux

    Description

      We are using mongo shell 2.0.4

      We have see something really strange in our mongo collection, which holding roughly 46 million records.

      When we do "db.CollectionOne.count()" through either mongo shell or java driver, we get 46 million records. However, when we use mongoexport, mongodump to dump ALL the records out, it will have only 43 million records. We even tried the java driver to have a cursor to write out all the records in the db collection, the result is still 43 million, not 46 million.
      The count command shows the result below:
      PRIMARY> db.CollectionOne.count()
      46676257

      The mongoexport shows the result below. (mongodump shows the same amount of number as mongoexport 43309967)
      connected to: 127.0.0.1
      exported 43309967 records
      EXPORTING FROM MONGODB IS DONE

      Our mongodb version is 2.0.4 and it is not a shard mongo. It is a replicate set only. The primary has two other replicate member in its group.

      Did anyone have experienced something like this before? Any suggestion will be very appreciated.

      Thanks

      Attachments

        Activity

          People

            Unassigned Unassigned
            pamongo Lynn Hsu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: