4. Querying Documents
Overview
This chapter discusses how to prepare and execute queries in MongoDB. You will learn how to find documents from a collection and limit the fields shown in the output. You will use various conditional and logical operators, as well as combinations of them, in a query and use regular expressions to find documents in a collection. By the end of this chapter, you will be able to run queries on arrays and nested objects, as well as limit, skip, and sort the records in the result set.