Introduction to mongoose Flashcards

1
Q

How do you get access to Mongoose?

A

By downloading it from npm, and requiring it in your JS file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the base MongoDB URL?

A

mongodb://localhost:27017

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you connect an Express.js application to a MongoDB database?

A

mongoose.connect(mongodbUrl/dbName, {useNewUrlParser: true, useCreateIndex: true, useFindAndModify: false}).then((data) => {console.log(‘DB connection message’);});

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Where are models and schemas stored?

A

In a separate folder called ‘models’.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly