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

mongorestore cannot recover collection containing "\n"

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: mongorestore
    • Labels:
      None
    • 454

      Note that the submitter closed their PRs without signing the CLA. Whoever works on this should implement this without looking at those PRs.

      Problem Statement/Rationale

      mongorestore cannot recover collection containing "\n"

      Steps to Reproduce

      use python to insert a value into the collection "test.\n"

      import pymongo
      
      conn = pymongo.MongoClient()
      conn['test'][chr(10)].save({"test": 1})
      
      
      

      use mongodump to dump all database

      mongodump --gzip --verbose --archive=1.backup --forceTableScan --oplog

      use mongorestore to restore the value

      mongorestore --gzip --verbose --archive=1.backup --oplogReplay  

      Expected Results

      find the value in the new instance

      use test
      db.getCollection("\n").find()
      

      Actual Results

      find nothing

      rs-0:PRIMARY> use test
      switched to db test
      rs-0:PRIMARY> db.getCollection("\n").find()
      rs-0:PRIMARY> 

      Additional Notes

            Assignee:
            Unassigned Unassigned
            Reporter:
            gaoziqi.1220@bytedance.com 子奇 高
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: