模块:Mongo::Operation::Find::Builder::Flags Private

定义于:
lib/ Mongo/operation/find/builder/flags.rb

Overview

该模块是私有 API 的一部分。 您应尽可能避免使用此模块,因为它将来可能会被删除或更改。

提供在发送Ruby和相关命令(例如 解释)。

由于:

  • 2.0.0

常量摘要折叠

MAPPINGS =

此常量是私有 API 的一部分。 应尽可能避免使用此常量,因为它将来可能会被删除或更改。

游标标志映射的选项。

由于:

  • 2.0.0

{
  allow_partial_results: [ :partial ],
  oplog_replay: [ :oplog_replay ],
  no_cursor_timeout: [ :no_cursor_timeout ],
  tailable: [ :tailable_cursor ],
  tailable_await: %i[await_data tailable_cursor],
  await_data: [ :await_data ],
  排气: [ :exhaust ],
}.冻结

类方法摘要折叠

类方法详细信息

.map_flags(options) ⇒ Array<Symbol>

此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。

将Ruby查找选项转换为标志大量。

输入哈希中不是映射到标志的选项的任何键都将被忽略。

参数:

  • 选项 ( Hash , BSON::Document )

    选项。

返回:

  • ( Array< Symbol > )

    标志。

由于:

  • 2.0.0



45
46
47
48
49
50
# File 'lib/ Mongo/operation/find/builder/flags.rb', line 45

module_function def map_flags(选项)
  mappings..each_with_object(选项[:flags] || []) do |(key, ), flags|
    cursor_type = 选项[:cursor_type]
    flags.推动(*) if 选项[key] || (cursor_type && cursor_type == key)
  end
end