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

mongodump query had different behavior if quotes are included

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.3.2
    • Affects Version/s: 2.2.0-rc0
    • Component/s: Tools
    • Labels:
      None
    • ALL

      ./mongodump -d local -c oplog.rs -q "{ts : { \"\$gte\" : { \$timestamp : { t : 1342670400000, i : 0 } } }}"
      connected to: 127.0.0.1
      Mon Jul 23 13:45:24 DATABASE: local      to     dump/local
      Mon Jul 23 13:45:24     local.oplog.rs to dump/local/oplog.rs.bson
      QUERY: { ts: { $gte: { $timestamp: { t: 1342670400000, i: 0 } } } }
      Mon Jul 23 13:45:30              0 objects
      Mon Jul 23 13:45:30     Metadata for local.oplog.rs to dump/local/oplog.rs.metadata.json
      

      vs:

       ./mongodump -d local -c oplog.rs -q "{ts : { \"\$gte\" : { \"\$timestamp\" : { \"t\" : 1342670400000, \"i\" : 0 } } }}"
      connected to: 127.0.0.1
      Mon Jul 23 13:45:55 DATABASE: local      to     dump/local
      Mon Jul 23 13:45:55     local.oplog.rs to dump/local/oplog.rs.bson
      QUERY: { ts: { $gte: Timestamp 1342670400000|0 } }
      Mon Jul 23 13:46:01             100/13786540    0%      (objects)
      Mon Jul 23 13:46:01              10038 objects
      Mon Jul 23 13:46:01     Metadata for local.oplog.rs to dump/local/oplog.rs.metadata.json
      

      Note, the line that starts with "QUERY" above was something I added to print the parsed query object taken from the json input. Notice that in the second output it prints an actual timestamp object, while in the first it's just a document with the field name of "$timestamp"

            Assignee:
            Unassigned Unassigned
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: