It is time to wrap up this rather lengthy chapter. Let's take a look at what we covered. In this chapter, we built a very simple blogging application using MongoDB as the database. Through the practical example we learned how to:
Insert documents into MongoDB
Perform safe inserts with timeout
Query documents with Mongo query language
Retrieve and iterate over queried documents using cursors
Update documents in MongoDB
Performing
'upsert'
operationPerforming atomic update with
$set, $unset, $inc
, and so onDelete documents in MongoDB
Querying embedded documents
We also learned about referenced and embedded objects, their use cases, and relative advantages over each other. In the next chapter, we will use these concepts to build something more practical and reusable. Stay tuned!