Module: Mongo::Collection::View::Builder::Flags
Overview
Provides behaviour for mapping flags.
Constant Summary collapse
- MAPPINGS =
Options to cursor flags mapping.
{ :allow_partial_results => [ :partial ], :oplog_replay => [ :oplog_replay ], :no_cursor_timeout => [ :no_cursor_timeout ], :tailable => [ :tailable_cursor ], :tailable_await => [ :await_data, :tailable_cursor], :await_data => [ :await_data ], :exhaust => [ :exhaust ] }.freeze
Instance Method Summary collapse
-
#map_flags(options) ⇒ Array<Symbol>
Maps an array of flags from the provided options.
Instance Method Details
#map_flags(options) ⇒ Array<Symbol>
Maps an array of flags from the provided options.
49 50 51 52 53 54 55 56 57 |
# File 'lib/mongo/collection/view/builder/flags.rb', line 49 def map_flags() MAPPINGS.each.reduce([:flags] || []) do |flags, (key, value)| cursor_type = [:cursor_type] if [key] || (cursor_type && cursor_type == key) flags.push(*value) end flags end end |