异常:Mongoid::Errors::DocumentNotFound
- 继承:
-
MongoidError
- 对象
- StandardError
- MongoidError
- Mongoid::Errors::DocumentNotFound
- 定义于:
- lib/mongoid/errors/document_not_Found.rb
Overview
通过特定 ID 或不存在的属性集在数据库中查询文档时引发此警报。 如果传递了多个 ID,则会显示所有这些 ID。
常量摘要
从MongoidError继承的常量
实例属性摘要折叠
-
# klass ⇒ 对象
只读
返回属性 klass 的值。
-
# params ⇒ 对象
只读
返回属性参数的值。
从MongoidError继承的属性
实例方法摘要折叠
从MongoidError继承的方法
构造函数详情
#initialize (klass, params, unmatched = nil) ⇒ DocumentNotFound
创建新的错误。
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/mongoid/errors/document_not_Found.rb', line 26 def 初始化(klass, params, unmatched = nil) if !unmatched && !params.is_a?(哈希) unmatched = 阵列(params) if params end @klass, @params = klass, params 超( ( (params, unmatched), { 类: klass.名称, 搜索: 搜索(params), 属性: params, 总数: 总计(params), 缺失: 缺失(unmatched), shard_key: shard_key(unmatched) } ) ) end |
实例属性详细信息
# klass ⇒对象(只读)
返回属性 klass 的值。
12 13 14 |
# File 'lib/mongoid/errors/document_not_Found.rb', line 12 def klass @klass end |
# params ⇒对象(只读)
返回属性参数的值。
12 13 14 |
# File 'lib/mongoid/errors/document_not_Found.rb', line 12 def params @params end |