Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12624

Support writing to (bson) files from shell

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Shell
    • 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@mongodb.com Geert Bosch
            Reporter:
            mikeo@mongodb.com Michael O'Brien
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: