Top MongoDB Interview Questions
MongoDB is a document database with the scalability and flexibility that you want with the querying and indexing that you need.
Education Funda |
Let's Jump Into Directly Top 10 MongoDB Interview Questions:
Important Notes
BSON vs JSON
- JSON is Standard File Format whereas BSON is Binary File Format.
- BSON is faster then JSON because it is more efficient and MongoDB stores data in BSON format via MongoDB drivers data converted when we save or update any data.
- JSON takes less storage space whereas BSON takes more space as compared between both.
- We can embed 100 JSON formats inside JSON maximum.
- BSON is an encoded format of data so not easily readable for humans whereas JSON we can easily read.
Objectld is composed of:
- Timestamp
- Client machine ID
- Client process ID
- 3 byte increment counter
UpdateOne() vs ReplaceOne()
With replaceOne() you can only replace the entire document, while updateOne() allows for updating fields.
Since replaceOne() replaces the entire document - fields in the old document not contained in the new will be lost. With updateOne() new fields can be added without losing the fields in the old document.
I hope this article will help you to crack interview easily.
Thanks for reading this article ✌
Comments
Post a Comment