-
Type: Improvement
-
Resolution: Unresolved
-
Priority: 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.
- is duplicated by
-
SERVER-14881 Ability to easily save cursor contents to file or collection
- Backlog
- is related to
-
SERVER-5447 Option to write shell commands and results to a file
- Closed
-
SERVER-18643 Output redirection from mongo shell
- Closed
-
SERVER-19791 Save mongo shell session into a file (gdb style)
- Closed
-
SERVER-12624 Support writing to (bson) files from shell
- Closed