MongoDB find() & the Cursor Object
Ok, this doesn’t count as an article but it is a small piece of information. Do you know what happens when your run find() command in mongo shell? If you said “It retrieves all data” you are wrong. It just gives you the cursor. Than cursor shows you the first 20 data. If you have more than 20 data, you can write it command to retrieve next 20. This is the feature in mongo shell. As you may notice you can not use .pretty() command with the findOne() method because .pretty method is a method of the Cursor Object not the find() method.













