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

MongoRestore using filter throws an error

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical - P2 Critical - P2
    • None
    • None
    • mongorestore
    • None
    • Windows..64 bit

    Description

      While restoring the data, I got an error with assertion 0....
      In the log file - I think below object ID was creating the problem. I couldn't find any option - that would ignore the error and continue restore. Hence decided to ignore to bad records that was captured in log file.

      Am using the following command to restore and it fails with an error below...

      mongorestore --collection ABC --noobjcheck --filter '{_id: ObjectId("53edbe5fceaa081d10052e20")}' --db test C:\Users\Myname\\Documents\mongo-task\MyName.bson
      Error parsing command line: too many positional options
      try 'mongorestore --help' for more information

      also, couldn't find the syntax for $ne. Will the below work?

      mongorestore --collection Leads --filter '{"_id":{$ne: ObjectId("53edbe5fceaa081d10052e20")}}'--db test C:\Users\MyName\Documents\mongo-task\Myname.bson

      Attachments

        Activity

          People

            adinoyi.omuya@mongodb.com Adinoyi Omuya
            rajesh.mandot@verifone.com Rajesh Mandot
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: