Since it is basically a javascript shell, you can also use toArray()
:
db.collection.find().toArray()
However, this will print all the documents of the collection unlike pretty()
that will allow you to iterate.
Refer: http://docs.mongodb.org/manual/reference/method/cursor.toArray/