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

Ability to output to file from mongo shell

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: JavaScript, Shell

      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.

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

              Created:
              Updated: