|
running mongodump with the correct args and dealing with extended json (shell escaping, quotes and $ characters etc) is very confusing and difficult.
it would be nice to just be able to run a query through the same shell mechanism and save it to a file.
Something like:
db.collection.find({created_at:{$lt:ISODate("2014-01-01T16:20:49.177Z")}).sort({created_at:1}).dump("/tmp/path_to_file.bson")
|
or if not part of cursor prototype, at least a shell helper to take a cursor and iterate it + write bson to local file on disk.
|