The Doctrine MongoDB project is an abstraction layer on top of the legacy PHP driver that the Doctrine MongoDB ODM project is built on top of.
Caution!
This project has been deprecated and the MongoDB ODM project will soon no longer depend on it. The project is also in bug-fixes-only mode.
Creating new connections is easy using the Doctrine\MongoDB\Connection
class:
With the connection you can start selecting databases using the selectDatabase
method:
Now you are ready to select a collection and insert some data using the insert
method:
Reading data is easy using the find
and findOne
methods:
Updating a record is simple using the update
method:
Delete data from the collection using the remove
method: