Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-2122

Inconsistent document count when using mongodump with the --query argument

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.6.6, 3.6.7
    • Component/s: mongodump
    • Labels:
      None
    • Environment:
      OSX (server and client)

      Inconsistent document count from mongodump when using the --query argument and performing an equality match on an object-based _id field.

      Problem appears to be reproducible on a standalone, RS or sharded cluster.

      Steps to Reproduce

      Data set

      db.coll.insertMany([
      { _id: {id: "ABC", version: 1}, text: "a" }
      { _id: {id: "ABC", version: 2}, text: "a" }
      { _id: {id: "ABC", version: 3}, text: "a" }
      { _id: {id: "ABC", version: 4}, text: "a" }
      { _id: {id: "ABC", version: 5}, text: "a" }
      { _id: {id: "ABC", version: 6}, text: "a" }
      { _id: {id: "ABC", version: 7}, text: "a" }
      ])
      

      mongodump command

      > mongodump -d test -c coll --query '{_id: {id: "ABC", version:7 }}'
      

      results

      ~ 90% of the time 1 document is dumped
      ~ 10% of the time 0 documents are dumped

            Assignee:
            david.golden@mongodb.com David Golden
            Reporter:
            mark.baker-munton@mongodb.com Mark Baker-Munton
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: