What is the primary difference between SQL and MongoDB's data models?
SQL is NoSQL, MongoDB is relational.
SQL is document-based, MongoDB is table-based.
SQL uses JSON, MongoDB uses BSON.
SQL is table-based, MongoDB is document-based.
How do you remove a collection named "products" from a MongoDB database?
drop products
remove collection products
db.products.drop()
delete products
Which of the following is NOT a commonly used MongoDB driver?
C# driver
Node.js driver
Java driver
Python driver
Which operator is commonly used within a $group stage to calculate the sum of a specific field?
$group
$max
$avg
$push
$sum
Which data type in MongoDB is used to store decimal numbers?
decimal
int
numberDecimal
double
What is the difference between deleteOne() and deleteMany() in MongoDB?
deleteOne()
deleteMany()
deleteOne() deletes documents permanently, while deleteMany() moves them to the trash.
deleteOne() deletes all documents, while deleteMany() deletes only the specified number of documents.
There is no difference; both commands perform the same action.
deleteOne() deletes the first matching document, while deleteMany() deletes all matching documents.
Which of the following best describes the relationship between documents and collections in MongoDB?
Collections are made up of multiple documents
Documents and collections are unrelated
Documents are fields within a collection
Collections define the structure of a document
What is the role of the MongoClient object in a MongoDB Node.js application?
MongoClient
To define the database schema
To execute queries against the database
To create and manage user accounts
To establish a connection to the MongoDB server
What is the command to download the latest stable release of MongoDB Community Edition on most Linux systems?
mongosh
sudo apt-get install -y mongodb-org
sudo systemctl start mongod
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
Which is NOT a valid index type in MongoDB?
Array Index
Full Text Index
Hashed Index
Spatial Index