类:Mongo::Operation::Update::Result
- 继承:
-
操作::结果
- 对象
- 操作::结果
- Mongo::Operation::Update::Result
- 定义于:
- lib/ Mongo/operation/ 更新/result.rb
Overview
定义更新结果的自定义行为。
常量摘要折叠
- 已修改 =
此常量是私有 API 的一部分。 应尽可能避免使用此常量,因为它将来可能会被删除或更改。
结果中已修改Docs字段的数量。
'nModified'- UPSERTED =
此常量是私有 API 的一部分。 应尽可能避免使用此常量,因为它将来可能会被删除或更改。
结果中更新或插入的Docs字段。
'更新或插入'
实例方法摘要折叠
- # bulk_result ⇒ 对象
-
#matched_count ⇒ 整数
获取匹配的文档数量。
-
#modified_count ⇒ Integer
获取已修改文档的数量。
-
#upserted_count ⇒ Integer
返回已更新或插入的文档数。
-
# upserted_id ⇒ 对象
所插入文档的标识符(如果进行更新或插入)。
实例方法详细信息
# bulk_result ⇒对象
101 102 103 |
# File 'lib/ Mongo/operation/ 更新/result.rb', line 101 def bulk_result BulkResult.new(@replies, connection_description) end |
#matched_count ⇒整数
获取匹配的文档数量。
46 47 48 49 50 51 52 53 54 |
# File 'lib/ Mongo/operation/ 更新/result.rb', line 46 def 匹配计数 return 0 除非 已确认? if upsert? 0 else n end end |
# Modified_count =" Integer "(整数)
获取已修改文档的数量。
65 66 67 68 69 |
# File 'lib/ Mongo/operation/ 更新/result.rb', line 65 def Modified_count return 0 除非 已确认? first[MODIFIED] end |
#upserted_count ⇒ Integer
返回已更新或插入的文档数。
96 97 98 |
# File 'lib/ Mongo/operation/ 更新/result.rb', line 96 def upserted_count upsert? ? n : 0 end |
# upserted_id ⇒对象
所插入文档的标识符(如果进行更新或插入)。
81 82 83 84 85 |
# File 'lib/ Mongo/operation/ 更新/result.rb', line 81 def upserted_id return nil 除非 upsert? upsert?.first['_id'] end |