Test yourself under real exam conditions: 50 timed questions, 60 on the clock, pass mark 70%%. Instant score with a full review of everything you got wrong. Free — no account needed.
Exam details
MongoDB is a NoSQL document-oriented database that stores data in flexible, JSON-like documents called BSON. It is designed for scalability and high performance, making it ideal for applications with rapidly evolving schemas and large volumes of unstructured or semi-structured data.
The document model stores data as documents, which are rich data structures similar to JSON objects. Each document can contain nested fields, arrays, and sub-documents, allowing related data to be stored together rather than spread across multiple tables as in relational databases.
BSON (Binary JSON) is the binary-encoded serialization format MongoDB uses to store documents and make remote procedure calls. It extends JSON with additional data types such as Date, ObjectId, int, long, double, and binary, enabling efficient storage and traversal.
An ObjectId is a 12-byte unique identifier automatically generated by MongoDB as the default _id field for each document. It consists of:
Use db.collection.insertOne() for a single document or db.collection.insertMany() for multiple documents. Example: db.users.insertOne({ name: "Alice", age: 30 }). MongoDB automatically adds an _id field if not provided.