Restore oplog Dump into another instance

mongodump --host=“rs0/localhost:27017,localhost:27018,localhost:27019” --readPreference=secondary -d local -c --query “{”$and":[{“o.msg”:{"$ne":“periodic noop”}},{“ns”:“hello.items”}]}"-vvv -o /home/anupama/backupec2/full_back

I used it to dump hello database from replicaset using oplog dump but I want to know how can i restore the hello database in another new instance from dump oplog file using mongorestore is

mongorestore ./backup/inc_back/local/oplog.bson

my bson dump output


Is this restore of a DB or a collection?

You can use --nsInclude with --db options

The --db option for mongodump specifies the source database to dump.
The --db option for mongorestore specifies the target database to restore into.

I tried but not working even oplog file is not getting changed in other instance.

I am collecting data from and looking to restore my db hello and collection item from the oplog.

So restore succeeds but you don’t see changes?
Did you try --drop option

--drop ``

Before restoring the collections from the dumped backup, drops the collections from the target database. --drop does not drop collections that are not in the backup.