Something of critical interest to developers is how to perform basic CRUD operations using ext/mongodb. You will note that PHPLIB, by design, is very closely modeled after the MongoDB JavaScript command set covered in Chapter 3, Using the Mongo Shell. The main difference is that instead of having arguments formulated as JSON expressions, when using PHPLIB, expressions use native PHP data types (for example, arrays, objects, and so on).
Performing CRUD operations using PHPLIB
Core PHPLIB class instances needed for CRUD operations
It is important to note that all of the CRUD operations that we are going to discuss require that you create a MongoDB\Collection instance. This can be accomplished in several ways, including:
- MongoDB...