Full-Stack Web Development with Vue.js and Node

(singke) #1
Introducing MEVN Chapter 1

Fetching all documents

To fetch all the records from the posts collection, run the following command:


> db.posts.find()

This will return all the documents that we have in the posts collection:


Fetching a specific document

Let's find a post where the title is MEVN. To do that, we can run:


> db.posts.find({ 'title': 'MEVN' })

This command will return only those documents whose title is MEVN:

Free download pdf