1/4
Looks like no tags are added yet.
What are the four key features of MongoDB's document database model listed in the slides?
PI query or query language
Distributed and resilient architecture
Flexible schema
Object mapping
Define what a Collection is in MongoDB. How does MongoDB handle documents within the same collection that possess different fields?
A collection is an organized store of documents in MongoDB, typically sharing common fields. Because MongoDB employs a flexible schema, two documents in the exact same collection can have different sets of fields (e.g., one user document contains user_id, age, Status, while another user document in the same collection includes an additional Country field)
How can schema validation be enforced on a MongoDB collection, and what capabilities does this provide?
Schema validation is configured on a per-collection basis, with the recommended approach being JSON Schema. It allows developers to configure a prescribed document structure, tune validation levels according to the use case, and inspect both document structure and content during query operations.
Compare JSON and BSON across encoding format, readability, parsing performance, and data type support.
Encoding: JSON uses human-readable text encoding; BSON uses binary-encoded serialization.
Readability: JSON is human-readable; BSON is machine-readable.
Parsing & Efficiency: JSON has slower parsing and is less efficient; BSON provides fast parsing, compact storage, and efficient encoding/decoding.
Data Types: JSON supports basic data types (strings, numbers, objects, arrays, booleans, null); BSON extends JSON with advanced binary types (e.g., ObjectId, UTC datetime, 32-bit/64-bit integers, Decimal128)
What three primary attributes make BSON optimized as MongoDB’s internal storage and network transfer format?
Lightweight: Minimizes unnecessary bloat to optimize physical storage size.
Traversable: Designed to allow quick traversal across documents and nested fields within documents.
Efficient: Encodes and decodes data rapidly to boost computational throughput and speed