Chapter 5. Constructing queries

This chapter covers

  • Querying an e-commerce data model
  • The MongoDB query language in detail
  • Query selectors and options

MongoDB doesn’t use SQL. It instead features its own JSON-like query language. You’ve explored this language throughout the book, but now let’s turn to some meatier, real-world examples. You’ll revisit the e-commerce data model introduced in the previous chapter and present a variety of queries against it. Among the queries you’ll practice are _id lookups, ranges, ordering, and projections. This chapter then surveys the MongoDB query language as a whole, looking at each available query operator in detail.

Keep in mind as you’re reading this chapter that MongoDB’s query language and aggregation ...

Get MongoDB in Action, Second Edition: Covers MongoDB version 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.