模块:Mongoid::Contextual::Command

包含在:
MapReduce
定义于:
lib/mongoid/contextual/command.rb

Overview

Mixin 模块包含在表示数据库命令的对象中。

实例属性摘要折叠

实例方法摘要折叠

实例属性详细信息

#集合对象(只读)

返回属性集合的值。



12
13
14
# File 'lib/mongoid/contextual/command.rb', line 12

def 集合
  @collection
end

# 集合要查询的集合。 (要查询的集合。) ⇒对象(只读)



12
# File 'lib/mongoid/contextual/command.rb', line 12

attr_reader :collection, :criteria

# 个条件对象(只读)

返回属性条件的值。



12
13
14
# File 'lib/mongoid/contextual/command.rb', line 12

def 条件
  @criteria
end

# Criteria 上下文的条件。 (Thecriteria) ⇒对象(只读)



12
# File 'lib/mongoid/contextual/command.rb', line 12

attr_reader :collection, :criteria

实例方法详细信息

#客户端Mongo::Client

获取数据库客户端。

例子:

获取客户端。

command.client

返回:

  • ( Mongo::Client )

    mongo客户端。



30
31
32
# File 'lib/mongoid/contextual/command.rb', line 30

def 客户端
  集合.database.客户端
end

#命令哈希

正在构建以发送到数据库的数据库命令。

例子:

获取命令。

command.command

返回:

  • (哈希)

    db 命令。



20
21
22
# File 'lib/mongoid/contextual/command.rb', line 20

def 命令
  @command ||= {}
end