I would like to copy a collection from one database to an instance on another server. From https://stackoverflow.com/a/3159605/212660/ ... questions , I understand that the correct way to do this is with this command:
{ cloneCollection: "<collection>", from: "<hostname>", query: { <query> } }
via http://docs.mongodb.org/manual/reference/command/cloneCollection/
However, I do not understand where should I enter this command? This is not accepted as ...
$ mongod { cloneCollection: "remote", from: "ec2-whatever-amazon.com"}
How to copy a remote collection from db.remote.collnameto db.local.collnameusing this cloneCollection syntax via the command line?
source
share