Databases & collections in MongoDB

basic · MongoDB — Documents & data modeling

Collection in MongoDB A collection is a group of documents. It is similar to a table in SQL databases Stores multiple documents Does not require a fixed schema Each document can have different structure users   // collection name Field in MongoDB A field is a key-value pair inside a document . It is similar to a column in SQL {   name: "Rahul",   age: 25,   city: "Hyderabad" } Relation Between Them Collection → contains multiple documents Document → contains multiple fields Database    ↓ Collection (like users)    ↓ Documents    ↓ Fields (name, age, etc.)

Back to MongoDB — Documents & data modeling

Browse all study material on Careeroza