Database Reference
In-Depth Information
Queries and aggregation
In this chapter
Querying an e-commerce data model
The MongoDB query language in detail
Aggregation with map-reduce and group
MongoDB doesn't use SQL . Rather, it features its own JSON -like query language.
We've been exploring this language throughout the topic, but here we turn to
some meatier, real-world examples. In particular, we're going to revisit the e-
commerce data model introduced in the last chapter and present a variety of que-
ries against it. Among the queries you'll practice are _id lookups, ranges, ordering,
and projections. We'll also survey the MongoDB query language as a whole, look-
ing at each available query operator in detail.
In addition to queries, we'll cover the related topic of aggregation. Queries
allow you to get at the data as it's stored; aggregation functions summarize and
reframe that data. First you'll see how to aggregate over this topic's sample
e-commerce data set, focusing on MongoDB's group and map-reduce functions.
Later I'll present a complete reference to these functions.
Keep in mind as you're reading this chapter that MongoDB's query language
and aggregation functions are still works in progress, and refinements are being
added with each release. As it stands, mastering queries and aggregations in
76
 
Search WWH ::




Custom Search