Revert mongorestore changes

78 Views Asked by At

Is there a way of reverting changes of mongorestore command? I couldn’t find anything useful in the docs. I’ve done it accidentally on a wrong local db instance.

1

There are 1 best solutions below

0
Joe On

If the data added by mongorestore did not use the same database and collection names as the data in the mongod, you can read those names from the directory/filenames in the dump directory and drop them from the mongod.

If it did use the same names, you will likely need to use an earlier backup.