-
Book Overview & Buying
-
Table Of Contents
PHP and MongoDB Web Development Beginner's Guide
In this chapter, we will focus on learning how to perform aggregation queries in MongoDB. In Chapter 2, Building your First MongoDB Powered Web App, we learned how to query a collection using the
find()method. Aggregation queries are different from the queries we have done so far. These queries perform certain computations/calculations on the documents and the result of the computation is sent back to the user. For instance, grouping the documents on the value of a certain field and counting their values is a kind of aggregation operation. If you have experience with SQL, aggregation queries are the ones that useCOUNT/SUM/AVG/GROUP BYstatements. MongoDB uses MapReduce, a functional programming paradigm to perform aggregation and batch processing of data. In this chapter, we are going to familiarize ourselves with the concepts of MapReduce. We will learn how to perform MapReduce queries both in the mongo shell and in PHP. We will also learn to use utility...
Change the font size
Change margin width
Change background colour