Full-Stack Web Development with Vue.js and Node

(singke) #1
Introducing MongoDB Chapter 3

The output should be as follows:


Retrieving documents


Retrieving documents from collections in MongoDB is done using the find() command.


There are many ways to use this command.


Finding all documents

To retrieve all documents from a collection, we can use:


> db.users.find()

We can also use the following:


> db.users.find({})
Free download pdf