$dbName
$dbName :
Mongo数据库驱动
setQuery(\think\mongo\Query $query, $model = 'db') : $this
指定当前使用的查询对象
\think\mongo\Query | $query | 查询对象 |
$model |
getQuery(string $model = 'db', string $queryClass = '') : \think\mongo\Query
创建指定模型的查询对象
string | $model | 模型类名称 |
string | $queryClass | 查询对象类名 |
query(string $namespace, \MongoDB\Driver\Query $query, \MongoDB\Driver\ReadPreference $readPreference = null, string|boolean $class = false, string|array $typeMap = null) : mixed
执行查询
string | $namespace | 当前查询的collection |
\MongoDB\Driver\Query | $query | 查询对象 |
\MongoDB\Driver\ReadPreference | $readPreference | readPreference |
string|boolean | $class | 返回的数据集类型 |
string|array | $typeMap | 指定返回的typeMap |
command(\MongoDB\Driver\Command $command, string $dbName = '', \MongoDB\Driver\ReadPreference $readPreference = null, string|boolean $class = false, string|array $typeMap = null) : mixed
执行指令
\MongoDB\Driver\Command | $command | 指令 |
string | $dbName | 当前数据库名 |
\MongoDB\Driver\ReadPreference | $readPreference | readPreference |
string|boolean | $class | 返回的数据集类型 |
string|array | $typeMap | 指定返回的typeMap |
execute(string $namespace, \MongoDB\Driver\BulkWrite $bulk, \MongoDB\Driver\WriteConcern $writeConcern = null) : \think\mongo\WriteResult
执行写操作
string | $namespace | |
\MongoDB\Driver\BulkWrite | $bulk | |
\MongoDB\Driver\WriteConcern | $writeConcern |