Support writing to (bson) files from shell

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Do
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Shell
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Geert Bosch
            Reporter:
            Michael O'Brien
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: