These exercises and solutions supplement the developerWorks knowledge path "Discover MongoDB."
- MongoDB supports query joins between collections.
- True
- False
- Replica sets in MongoDB offer the following benefits (pick all that apply):
- Data redundancy
- Distributed transaction support
- Automated failover & high availability
- Disaster recovery
- In replica sets, all write requests are automatically sent to secondary nodes directly.
- True
- False
- MongoDB documents are represented as XML.
- True
- False
- Fix this query:
db.words.find({}).orderBy({spelling:1}) - Fix this query:
db.words.find({}).sort({spelling:1}).rows(3) - Searching for elements in a document array requires you specify a positional element (i.e. document.arrary[i]).
- True
- False
- MongoDB enforces attribute similarity across documents in a collection (i.e. all word documents must have an array of synonyms).
- True
- False
- To find all documents that do not contain the attribute 'synonyms' this
query will work.
db.words.find({synonyms:{$exist:false}}) - True
- False
- In Mongo, frequently accessed data is stored:
- On disk
- In memory
- MongoDB supports indexes just like any other relational database.
- True
- False
- Indexes can make document queries faster but:
- They can make inserts and updates slightly slower
- Require specialized query commands to even be leveraged (in other words, hints)
- They do not work in a replica set environment
Check your answers here.
-
Discover MongoDB: Follow this knowledge path to master MongoDB's basic and advanced capabilities, and start using it in your programming.
-
developerWorks Java technology zone: Find hundreds of articles about every aspect of Java programming.

Andrew Glover is a developer, author, speaker, and entrepreneur with a passion for behavior-driven development, Continuous Integration, and Agile software development. He is the founder of the easyb Behavior-Driven Development (BDD) framework and is the co-author of three books: Continuous Integration, Groovy in Action, and Java Testing Patterns. You can keep up with him at his blog and by following him on Twitter.



