| Class | Mongo::Protocol::Query::Upconverter |
| In: |
lib/mongo/protocol/query.rb
|
| Parent: | Object |
Converts legacy query messages to the appropriare OP_COMMAND style message.
@since 2.1.0
| OPTION_MAPPINGS | = | { :project => 'projection', :skip => 'skip', :limit => 'limit', :batch_size => 'batchSize' |
Mappings of the options to the find command options.
@since 2.1.0 |
|
| SPECIAL_FIELD_MAPPINGS | = | { :$readPreference => 'readPreference', :$orderby => 'sort', :$hint => 'hint', :$comment => 'comment', :$returnKey => 'returnKey', :$snapshot => 'snapshot', :$maxScan => 'maxScan', :$max => 'max', :$min => 'min', :$maxTimeMS => 'maxTimeMS', :$showDiskLoc => 'showRecordId', :$explain => 'explain' | ||
| FLAG_MAPPINGS | = | { :tailable_cursor => 'tailable', :oplog_replay => 'oplogReplay', :no_cursor_timeout => 'noCursorTimeout', :await_data => 'awaitData', :partial => 'allowPartialResults' |
Mapping of flags to find command
options.
@since 2.1.0 |
|
| FIND | = | 'find'.freeze |
Find command constant.
@since 2.1.0 |
|
| FILTER | = | 'filter'.freeze |
Filter attribute constant.
@since 2.1.0 |
Instantiate the upconverter.
@example Instantiate the upconverter.
Upconverter.new('users', { name: 'test' }, { skip: 10 })
@param [ String ] collection The name of the collection. @param [ BSON::Document, Hash ] filter The filter or command. @param [ BSON::Document, Hash ] options The options. @param [ Array<Symbol> ] flags The flags.
@since 2.1.0