I am running queries from mongo shell and get responses back on the screen. I want to get the response and store it to a file(text or js for example).
For example: to store db.persons.find({});
to a persons.js file on current path on the terminal Users/david/my_files
How can I do that?