Every document has a unique _id field. If you don't provide one, MongoDB generates an ObjectId: a 12-byte value that encodes creation time, random machine/process bits, and a counter — so it is unique without any coordination between servers.
ObjectId("64f1a2b3c4d5e6f7a8b9c0d1")
// |--------|----------|------|
// timestamp random counter
// (4 bytes) (5 bytes) (3 bytes)BSON types you'll actually use
String, Number (int32, int64, double, decimal128), Boolean, Date, Array, Object (embedded document), ObjectId, Null, and Binary. BSON keeps type information, so "42" (string) and 42 (number) are different values — a common source of query bugs.
Embedding vs referencing
You can nest related data inside a document (embedding) or store an id pointing to a document in another collection (referencing). Rule of thumb: *data that is read together should be stored together* — embed by default, reference when data is shared, unbounded, or updated independently.
// Embedding
{ name: "Aarav", address: { city: "Mumbai", zip: "400001" } }
// Referencing
{ name: "Aarav", addressId: ObjectId("...") }