Specifically, I want to print the results of a mongodb find() to a file. The JSON object is too large so I\'m unable to view the entire object with the shell wi
find()
I managed to save result with writeFile() function.
> writeFile("/home/pahan/output.txt", tojson(db.myCollection.find().toArray()))
Mongo shell version was 4.0.9