What is the main purpose of a MongoDB driver?
B
To run MongoDB in the browser
C
To connect an application to MongoDB
D
To host MongoDB on mobile devices
Analysis & Theory
Drivers allow applications written in various programming languages to connect to and interact with MongoDB databases.
Which of the following is a **MongoDB official driver**?
Analysis & Theory
`pymongo` is the official MongoDB driver for Python.
Which language uses `mongodb` and `MongoClient` from the `mongodb` NPM package?
Analysis & Theory
Node.js uses the official `mongodb` package and `MongoClient` to connect to MongoDB.
What does this line do in Node.js?
`const client = new MongoClient(uri);`
A
Starts a MongoDB server
C
Creates a connection client to MongoDB
Analysis & Theory
`MongoClient(uri)` initializes a client that can connect to the specified MongoDB URI.
Which MongoDB driver is used in Java applications?
Analysis & Theory
`mongodb-driver-sync` is one of the official Java drivers provided by MongoDB.
In Python, how do you connect to a local MongoDB database?
A
`MongoClient('localhost:27017')`
B
`MongoClient('mongodb://localhost:27017/')`
C
`connect.Mongo('127.0.0.1')`
Analysis & Theory
The correct URI format is: `'mongodb://localhost:27017/'`.
What must be done **before** performing any operations using a driver?
Analysis & Theory
You must establish a **connection** to MongoDB using the driver before querying or writing data.
Which driver supports reactive streams in Java?
B
mongodb-driver-reactivex
D
mongodb-driver-reactivestreams
Analysis & Theory
The `mongodb-driver-reactivestreams` is the official reactive stream driver for Java.
Which MongoDB driver supports browser environments directly?
Analysis & Theory
MongoDB Realm SDKs (JavaScript) allow direct access from browsers or React Native apps using Data API or Realm Sync.
What is a **connection string URI** used for in drivers?
B
To format data before insertion
C
To specify connection details like host, port, and credentials
D
To assign driver version
Analysis & Theory
Connection strings define how and where a driver connects to MongoDB (e.g., `mongodb+srv://...`).