Q10. How does a primary key work in NoSQL databases?
Most NoSQL databases give every record a unique identifier. In MongoDB it's the _id field, auto-generated as an ObjectId if you don't set one. In key-value and wide-column stores, the key you choose is the primary way you fetch and distribute data.
The difference from relational primary keys is that in distributed NoSQL the key often doubles as the partition key, so it decides both uniqueness and which node the data lives on. That makes key choice a bigger deal than it is in a single-node relational table.
Key point: Point out that the key often doubles as the partition key in distributed stores. That link between identity and data placement is a favorite follow-up.