I am trying to create some mongoDB script (files upload to collections, find, create new collections etc). Though get confused. When I run in console:
> use importCSV
> db.people.find().pretty()
I get documents from collection on my screen, though when I run load command
> load('e:/work/parse/script.js')
i get output
true
Here javaScript file list
db = db.getSiblingDB('importCSV');
db.people.find().pretty();
I do it for debug purpose, so I create javaScript line by line to get what I want, and I need to see step by step some commands output. If I put to javaScript file command like this
print('Print from javaScript file');
it prints to console without any problems.
Why I get "true" when run from file instead of console output, and how to get list of documents printed when run from javaScript file?
Thanks