模块:Mongo::Operation::Result::Aggregatable Private
- 定义于:
- lib/ Mongo/operation/shared/result/aggregatable.rb
Overview
该模块是私有 API 的一部分。 您应尽可能避免使用此模块,因为它将来可能会被删除或更改。
定义批量写入结果的自定义行为
实例方法摘要折叠
-
#aggregate_write_concern_errors (count) ⇒ 数组
private
聚合从此结果返回的写关注错误。
-
#aggregate_write_errors (count) ⇒ 数组
private
聚合从此结果返回的写入错误。
实例方法详细信息
#aggregate_write_concern_errors (count) ⇒数组
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
聚合从此结果返回的写关注错误。
58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/ Mongo/operation/shared/result/aggregatable.rb', line 58 def aggregate_write_concern_errors(数数) return 除非 @replies @replies.each_with_index.化简(reduce)(nil) do |errors, (回复, _)| 来年 除非 write_concern_errors = 回复.文档.first[' writeConcernErrors '] (errors || []) << write_concern_errors.化简(reduce)(nil) do |errs, wce| wce.合并!(' index ' => 数数 + wce[' index ']) (errs || []) << write_concern_error end end end |
#aggregate_write_errors (count) ⇒数组
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
聚合从此结果返回的写入错误。
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/ Mongo/operation/shared/result/aggregatable.rb', line 35 def aggregate_write_errors(数数) return 除非 @replies @replies.化简(reduce)(nil) do |errors, 回复| 来年 除非 write_errors = 回复.文档.first[' writeErrors '] wes = write_errors.收集 do |我们| 我们.合并!(' index ' => 数数 + 我们[' index ']) end (errors || []) << wes if wes end end |