Mongo Interview Questions

Mongo Interview Questions


Mongo Beginner

Question
What are the advantages of MongoDB? Or in other words, why choosing MongoDB and not other implementation of NoSQL?
                    

Question
What is the difference between SQL and NoSQL?

The main difference is that SQL databases are structured (data is stored in the form of
tables with rows and columns - like an excel spreadsheet table) while NoSQL is 
unstructured, and the data storage can vary depending on how the NoSQL DB is set up, such
as key-value pair, document-oriented, etc.
                    

Question
In what scenarios would you prefer to use NoSQL/Mongo over SQL?

  * Heterogeneous data which changes often
  * Data consistency and integrity is not top priority
  * Best if the database needs to scale rapidly
                    

Question
What is a document? What is a collection?
                    

Question
What is an aggregator?
                    

Question
What is better?. Embedded documents or referenced?
                    
##### Queries
Question
Explain this query: db.books.find({"name": /abc/})
                    

Question
Explain this query: db.books.find().sort({x:1})