Definition
- MongoDB\Collection
- Provides methods for common operations on collections and documents, including CRUD operations and index management. - You can construct collections directly using the extension's MongoDB\Driver\Manager class or select a collection from the library's - MongoDB\Clientor- MongoDB\Databaseclasses. A collection may also be cloned from an existing- MongoDB\Collectionobject by using the- withOptions()method.- MongoDB\Collectionsupports the readConcern, readPreference, typeMap, and writeConcern options. If you omit an option, the collection inherits the value from the Manager constructor argument or the- Clientor- Databaseobject used to select the collection.- Operations within the - MongoDB\Collectionclass inherit the collection's options.