mongodump --host=“rs0/localhost:27017,localhost:27018,localhost:27019” --readPreference=secondary -d local -c oplog.rs --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
{
"ts":{
"$timestamp":{
"t":1585005237,
"i":1
}
},
"t":{
"$numberLong":"1"
},
"h":{
"$numberLong":"0"
},
"v":{
"$numberInt":"2"
},
"op":"i",
"ns":"hello.items",
"ui":{
"$binary":{
"base64":"q6+dIqy6TJihZj02fwNm7w==",
"subType":"04"
}
},
"wall":{
"$date":{
"$numberLong":"1585005237006"
}
},
"o":{
"_id":{
"$oid":"5e7942b415f1175f7de3440c"
},
"name":"Raushan",
"branch":"cse"
}
}