I'd like to copy a collection from one database to an instance on another server. From other stackoverflow questions, I understand the correct way to do that is with this command:
{ cloneCollection: "<collection>", from: "<hostname>", query: { <query> } }
via http://docs.mongodb.org/manual/reference/command/cloneCollection/
However, I don't understand where do I enter this command? It isn't accepted as...
$ mongod { cloneCollection: "remote", from: "ec2-whatever-amazon.com"}
How do I copy a remote collection at db.remote.collname
to db.local.collname
using this cloneCollection syntax via command line?