MongoDB\Driver下各大类简单介绍

12 篇文章 0 订阅

原本的mongo扩展没有这么麻烦,但是奈何我Ubuntu的操作系统,装不了mongo的扩展,只能装mongodb,所以,加油吧。

Manager

我的上一篇文章

入口文件

Command

The MongoDB\Driver\Command class is a value object that represents a database command.

To provide “Command Helpers” the MongoDB\Driver\Command object should be composed.

MongoDB\Driver\Command类的有效对象主要用于执行命令。

该类是最终类(final),俗称黑寡妇。

Query

The MongoDB\Driver\Query class is a value object that represents a database query.

MongoDB\Driver\Query类的有效对象主要用于查询。

BulkWrite

The MongoDB\Driver\BulkWrite collects one or more write operations that should be sent to the server. After adding any number of insert, update, and delete operations, the collection may be executed via MongoDB\Driver\Manager::executeBulkWrite().

Write operations may either be ordered (default) or unordered. Ordered write operations are sent to the server, in the order provided, for serial execution. If a write fails, any remaining operations will be aborted. Unordered operations are sent to the server in an arbitrary order where they may be executed in parallel. Any errors that occur are reported after all operations have been attempted.

当执行一次或者多次MongoDB\Driver\BulkWrite的insert、update、delete操作后,只会在执行MongoDB\Driver\Manager::executeBulkWrite()方法的时候,将数据发送给服务器。

写操作要么是有序的(默认设置),要么是无序的。当有多条记录需要执行时,有序的写操作根据添加顺序依次发送给服务器。中间发生错误时,还未发送的数据则消失。无序的操作会把记录无序的发送给服务器,即使这些记录是需要并行发送的。任何错误都会在所有记录都被尝试发送完后报告。

WriteConcern

MongoDB\Driver\WriteConcern describes the level of acknowledgement requested from MongoDB for write operations to a standalone mongod or to replica sets or to sharded clusters. In sharded clusters, mongos instances will pass the write concern on to the shards.

MongoDB\Driver\WriteConcern描述在向单独的mongod服务器、集群或者分片请求写数据库时的确认程度。在分片中,mongos实例会把write concern传递给分片。

ReadPreference

ReadConcern

MongoDB\Driver\ReadConcern controls the level of isolation for read operations for replica sets and replica set shards. This option requires the WiredTiger storage engine and MongoDB 3.2 or later.

Cursor

The MongoDB\Driver\Cursor class encapsulates the results of a MongoDB command or query and may be returned by MongoDB\Driver\Manager::executeCommand() or MongoDB\Driver\Manager::executeQuery(), respectively.

MongoDB\Driver\Cursor类分别封装了MongoDB\Driver\Manager::executeCommand(),MongoDB\Driver\Manager::executeQuery()的返回结果。

CursorId

Server

WriteConcernError

WriteError

WriteResult

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值