6.1. Comparing Documents in MongoDB and PHP6.2. MongoDB Classes6.3. Connecting and Disconnecting6.4. Inserting Data6.5. Listing Your Data6.5.1. Returning a Single Document6.5.2. Listing All Documents6.5.3. Using Query Operators6.5.4. Querying for Specific Information6.5.5. Sorting, Limiting, and Skipping Items6.5.6. Counting the Number of Matching Results6.5.7. Grouping Data with Map/Reduce6.5.8. Specifying the Index with Hint6.5.9. Refining Queries with Conditional Operators6.5.9.1. Using the $lt, $gt, $lte, and $gte Operators6.5.9.2. Finding Documents that Don't Match a Value6.5.9.3. Matching Any of Multiple Values with $in6.5.9.4. Matching All Criteria in a Query with $all6.5.9.5. Searching for Multiple Expressions with $or6.5.9.6. Retrieving a Specified Number of Items with $slice6.5.9.7. Determining Whether a Field Has a Value6.5.10. Regular Expressions6.6. Modifying Data with PHP6.6.1. Updating via update()6.6.2. Saving Time with Modifier Operators6.6.2.1. Increasing the Value of a Specific Key with $inc6.6.2.2. Changing the Value of a Key with $set6.6.2.3. Deleting a Field with $unset6.6.2.4. Appending a Value to a Specified Field with $push6.6.2.5. Adding Multiple Values to a Key with $pushAll6.6.2.6. Adding Data to an Array with $addToSet6.6.2.7. Removing an Element from an Array with $pop6.6.2.8. Removing Each Occurrence of a Value with $pull6.6.2.9. Removing Each Occurrence of Multiple Elements6.6.3. Upserting Data with save()6.6.4. Modifying a Document Atomically6.7. Deleting Data6.8. DBRef6.8.1. Retrieving the Information6.9. GridFS and the PHP Driver6.9.1. Storing Files6.9.2. Adding More Metadata to Stored Files6.9.3. Retrieving Files6.9.4. Deleting Data6.10. Summary