MongoDB\Driver classes

The MongoDB\Driver namespace includes 14 classes. Four of these classes allow for the manipulation of read and write concerns. Read concerns (https://docs.mongodb.com/manual/reference/read-concern/#read-concern) allow control over which replica set the data is drawn from. Write concerns (https://docs.mongodb.com/manual/reference/write-concern/#write-concern) control the level of acknowledgement between replicas. Read and write concerns are beyond the scope of this chapter, however. Please refer to Chapter 6Maintaining MongoDB Performance, for more information.

Two of the classes, Command and Query, are value objects: objects which are used primarily as wrappers for various bits of functionality, and then thrown away ...

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.