[SERVER-14880] Ability to output to file from mongo shell Created: 13/Aug/14  Updated: 10/May/22

Status: Backlog
Project: Core Server
Component/s: JavaScript, Shell
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Kevin Pulo Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Unresolved Votes: 6
Labels: ml-retriage, move-sa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-14881 Ability to easily save cursor content... Backlog
Related
is related to SERVER-5447 Option to write shell commands and re... Closed
is related to SERVER-18643 Output redirection from mongo shell Closed
is related to SERVER-19791 Save mongo shell session into a file ... Closed
is related to SERVER-12624 Support writing to (bson) files from ... Closed
Participants:

 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.



 Comments   
Comment by Steven Vannelli [ 10/May/22 ]

Moving this ticket to the Backlog and removing the "Backlog" fixVersion as per our latest policy for using fixVersions.

Generated at Thu Feb 08 03:36:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.