文档菜单
文档首页
/ / /
PHP库手册
/

MongoDB\Collection类

本页内容

  • 定义
  • 方法
MongoDB\Collection

提供了在集合和文档上执行常见操作的方法,包括CRUD操作和索引管理。

您可以使用扩展的MongoDB\Driver\Manager类直接构建集合,或者从库的MongoDB\ClientMongoDB\Database类中选择一个集合。集合还可以通过withOptions()方法从一个现有的MongoDB\Collection对象进行克隆。

MongoDB\Collection supports the readConcern, readPreference, typeMap, and writeConcern options. If you omit an option, the collection inherits the value from the Manager constructor argument or the Client or Database object used to select the collection.

MongoDB\Collection 类中执行的操作继承了集合的选项。

返回

withOptions()

本页内容