Restore can drop the target of the restore, but if both are on the same cluster then it just makes sense to use the $out option.

There are also options to do with indexes that you may want to take a look at.

If you’re doing a drop and restore, that’s going to be a script anyway surely? You’re not going to type in the command manually each time you want to do this? You could just put the mongosh call with the command to $out between databases in a one line batch / shell file.

If you’re possibly going to split up the Prod and dev then it makes sense to get something in place that could work in the future and not have to be engineered.

Also be wary of users setup and permissions if you have the prod and dev environments on the same cluster…seems to be a recipie for something bad to happen!

1 Like