MongoDB\Database Class
Definition
MongoDB\Database
Provides methods for common operations on a database, such as executing database commands and managing collections.
You can construct a database directly using the extension's
MongoDB\Driver\Managerclass or select a database from the library'sMongoDB\Client
class. A database may also be cloned from an existingMongoDB\Database
object by using thewithOptions()
method.MongoDB\Database
supports the readConcern, readPreference, typeMap, and writeConcernoptions. If you omit an option, the database inherits the value from the Managerconstructor argument or theClient
object used to select the database.Operations within the
MongoDB\Database
class inherit the Database's options.