模块:Mongoid::Selectable

扩展方式:
ActiveSupport::Concern
包含在:
Composable , Criteria::Queryable
定义于:
lib/mongoid/selectable.rb

Overview

提供为特定文档生成选择器的行为。

实例方法摘要折叠

实例方法详细信息

#atomic_selector哈希

获取document的原子选择器。这是最简单情况下的哈希 { "_id" => id },但对于嵌入式文档和使用分片键的 document 可能会变得更复杂。

例子:

Get the document's atomic selector.

document.atomic_selector

返回:

  • (哈希)

    The document's selector。



16
17
18
# File 'lib/mongoid/selectable.rb', line 16

def atomic_selector
  嵌入式? ? embedded_atomic_selector : root_atomic_selector_in_db
end