Module: Mongo::Collection::View::Builder::Modifiers
- Extended by:
- Modifiers
- Included in:
- Modifiers
- Defined in:
- lib/mongo/collection/view/builder/modifiers.rb
Overview
Provides behaviour for mapping modifiers.
Constant Summary collapse
- DRIVER_MAPPINGS =
Mappings from driver options to legacy server values.
BSON::Document.new( sort: '$orderby', hint: '$hint', comment: '$comment', snapshot: '$snapshot', max_scan: '$maxScan', max_value: '$max', min_value: '$min', max_time_ms: '$maxTimeMS', return_key: '$returnKey', show_disk_loc: '$showDiskLoc', explain: '$explain' ).freeze
- SERVER_MAPPINGS =
Mappings from server values to driver options.
BSON::Document.new(DRIVER_MAPPINGS.invert).freeze
Class Method Summary collapse
-
.map_driver_options(modifiers) ⇒ BSON::Document
Transform the provided server modifiers to driver options.
-
.map_server_modifiers(options) ⇒ BSON::Document
Transform the provided options into a document of only server modifiers.
Class Method Details
.map_driver_options(modifiers) ⇒ BSON::Document
Transform the provided server modifiers to driver options.
58 59 60 |
# File 'lib/mongo/collection/view/builder/modifiers.rb', line 58 def self.(modifiers) Options::Mapper.transform_documents(modifiers, SERVER_MAPPINGS) end |
.map_server_modifiers(options) ⇒ BSON::Document
Transform the provided options into a document of only server modifiers.
73 74 75 |
# File 'lib/mongo/collection/view/builder/modifiers.rb', line 73 def self.map_server_modifiers() Options::Mapper.transform_documents(, DRIVER_MAPPINGS) end |