0% found this document useful (0 votes)
53 views3 pages

MCQ Node

The document contains a series of questions and answers about Node.js, MongoDB, and how to interact with MongoDB using Node.js. Node.js is a runtime environment for executing JavaScript code, MongoDB is a database management system for storing and retrieving data, and the mongodb module allows Node.js to interact with MongoDB databases. The document covers topics like installing MongoDB drivers in Node.js, starting the MongoDB server, connecting to it, default ports, creating/inserting/updating/deleting databases and collections, and more.

Uploaded by

Tdm Don
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views3 pages

MCQ Node

The document contains a series of questions and answers about Node.js, MongoDB, and how to interact with MongoDB using Node.js. Node.js is a runtime environment for executing JavaScript code, MongoDB is a database management system for storing and retrieving data, and the mongodb module allows Node.js to interact with MongoDB databases. The document covers topics like installing MongoDB drivers in Node.js, starting the MongoDB server, connecting to it, default ports, creating/inserting/updating/deleting databases and collections, and more.

Uploaded by

Tdm Don
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

 What is Node.js? A.

A server-side runtime environment for executing JavaScript


code. B. A client-side framework for building responsive web applications. C. A
database management system for storing and retrieving data. D. A markup
language for creating web pages.

Answer: A

 What is MongoDB? A. A server-side runtime environment for executing JavaScript


code. B. A client-side framework for building responsive web applications. C. A
database management system for storing and retrieving data. D. A markup
language for creating web pages.

Answer: C

 Which module is used to interact with MongoDB in Node.js? A. http B. fs C. net D.


mongodb

Answer: D

 How do you install MongoDB driver for Node.js? A. npm install mongodb B. npm
install mongodb-driver C. npm install mongo-client D. npm install mongo-driver

Answer: A

 Which command is used to start the MongoDB server? A. mongod B. mongo C.


mongos D. mongodump

Answer: A

 Which command is used to connect to the MongoDB server from the command
line? A. mongod B. mongo C. mongos D. mongodump

Answer: B

 What is the default port number for the MongoDB server? A. 27017 B. 27018 C.
27019 D. 27020

Answer: A

 Which method is used to create a new database in MongoDB? A.


createDatabase() B. newDatabase() C. db.create() D. None of the above
Answer: D

 Which method is used to create a new collection in MongoDB? A.


createCollection() B. newCollection() C. db.createCollection() D. None of the
above

Answer: C

 How do you insert a document into a collection in MongoDB using Node.js? A.


collection.insert() B. collection.create() C. collection.add() D. collection.insertOne()

Answer: D

 How do you insert multiple documents into a collection in MongoDB using


Node.js? A. collection.insertMany() B. collection.createMany() C.
collection.addMany() D. collection.insert()

Answer: A

 How do you retrieve all documents from a collection in MongoDB using Node.js?
A. collection.getAll() B. collection.find() C. collection.fetchAll() D.
collection.retrieveAll()

Answer: B

 How do you retrieve a single document from a collection in MongoDB using


Node.js? A. collection.getOne() B. collection.findOne() C. collection.fetchOne() D.
collection.retrieveOne()

Answer: B

 How do you update a document in a collection in MongoDB using Node.js? A.


collection.updateOne() B. collection.update() C. collection.modify() D.
collection.change()

Answer: A

 How do you update multiple documents in a collection in MongoDB using


Node.js? A. collection.updateMany() B. collection.updateAll() C.
collection.modifyMany() D. collection.changeAll()

Answer: A
 How do you delete a document from a collection in MongoDB using Node.js? A.
collection.deleteOne() B. collection.remove() C. collection.erase() D.
collection.destroy()

Answer: A

 How do you delete multiple documents from a collection in MongoDB using


Node.js? A. collection.deleteMany() B. collection.removeAll() C.
collection.eraseMany() D. collection.destroyAll()

Answer: A

 How do you drop a collection in MongoDB using Node.js? A. collection.drop() B.


collection.remove() C. collection.erase() D.

You might also like