MongoDB PHP extension classes

The MongoDB PHP extension (which we will refer to simply as ext/mongodb for brevity) contains four main classes. Each class has its own PHP namespace. So, for example, if you wish to create an instance of the MongoDB\Driver\Command class, you would need to proceed as follows:

<?php namespace Application; use MongoDB\Driver\Command; $command = new Command();

The main classes we will cover in this section are MongoDB\Driver, MongoDB\BSON, MongoDB\Driver\Monitoring, and MongoDB\Driver\Exception.

Get MongoDB 4 Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.