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

Ability to output to file from mongo shell

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • JavaScript, Shell

    Description

      It would be useful to have a version of print() that can output to a file, eg.

      fprint("/tmp/whatever", "some message")
      

      A nice bonus would be to also flush or close the file descriptors (closing the file after every fprint would be terrible for performance), eg:

      fflush("/tmp/whatever")
      

      fclose("/tmp/whatever")
      

      And passing no parameters flushes/closes all open files:

      fflush()
      

      fclose()
      

      The above example usage is more or less the model used by awk/gawk.

      Attachments

        Activity

          People

            backlog-server-platform DO NOT USE - Backlog - Platform Team
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            6 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

              Created:
              Updated: