findOne() leads to pretty-print json object.
find() leads to jarbled json object.
How do i make
find() just like
findOne(), if this involves display within the mongo spend?
eg : db.yourcollection.find().pretty()
The cursor object came back by
forEach(), to help you use:
However observe that, unlike the default creation of
find() which shows the very first 10 objects then allows you select whether or not to continue iterating or otherwise,
forEach() will iterate the whole result set. Thus in case your query returns many results, this might require sometime and might not be terribly useful.
limit() is the friend here.