Loading

Quipoin Menu

Learn • Practice • Grow

mongodb / Introduction to Mongoose
mcq
Direction: Choose the correct option

Q1.

What is Mongoose?
A. A GUI tool for MongoDB
B. An Object Data Modeling (ODM) library for MongoDB and Node.js
C. A query language
D. A MongoDB driver for Node.js
Direction: Choose the correct option

Q2.

What is a key benefit of using Mongoose over the native driver?
A. It allows you to define schemas and validation
B. It is faster than the native driver
C. It supports SQL queries
D. It automatically scales databases
Direction: Choose the correct option

Q3.

How do you install Mongoose in a Node.js project?
A. npm i -g mongoose
B. npm install mongodb-odm
C. npm install mongoose
D. npm add mongoose-odm
Direction: Choose the correct option

Q4.

Which method connects Mongoose to a MongoDB database?
A. MongoClient.connect()
B. mongoose.createConnection()
C. Both A and B
D. mongoose.connect()
Direction: Choose the correct option

Q5.

What does Mongoose return when a connection is successful?
A. A MongoClient instance
B. The database object
C. A Mongoose connection instance
D. A promise