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

Support writing to (bson) files from shell

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Shell
    • None

    Description

      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.

      Attachments

        Activity

          People

            geert.bosch@mongodb.com Geert Bosch
            mikeo@mongodb.com Michael O'Brien
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: