Class: Mongo::Collection::View::Builder::FindCommand
- Inherits:
-
Object
- Object
- Mongo::Collection::View::Builder::FindCommand
- Extended by:
- Forwardable
- Defined in:
- lib/mongo/collection/view/builder/find_command.rb
Overview
Builds a find command specification from options.
Constant Summary collapse
- MAPPINGS =
The mappings from ruby options to the find command.
BSON::Document.new( sort: 'sort', projection: 'projection', hint: 'hint', skip: 'skip', limit: 'limit', batch_size: 'batchSize', single_batch: 'singleBatch', comment: 'comment', max_scan: 'maxScan', max_time_ms: 'maxTimeMS', max_value: 'max', min_value: 'min', return_key: 'returnKey', show_disk_loc: 'showRecordId', snapshot: 'snapshot', tailable: 'tailable', tailable_cursor: 'tailable', oplog_replay: 'oplogReplay', no_cursor_timeout: 'noCursorTimeout', await_data: 'awaitData', allow_partial_results: 'allowPartialResults', read_concern: 'readConcern', collation: 'collation' ).freeze
Instance Method Summary collapse
-
#explain_specification ⇒ Hash
Get the specification for an explain command that wraps the find command.
-
#initialize(view) ⇒ FindCommand
constructor
Create the find command builder.
-
#specification ⇒ Hash
Get the specification to pass to the find command operation.
Constructor Details
#initialize(view) ⇒ FindCommand
Create the find command builder.
78 79 80 |
# File 'lib/mongo/collection/view/builder/find_command.rb', line 78 def initialize(view) @view = view end |
Instance Method Details
#explain_specification ⇒ Hash
Get the specification for an explain command that wraps the find command.
66 67 68 |
# File 'lib/mongo/collection/view/builder/find_command.rb', line 66 def explain_specification { selector: { explain: find_command }, db_name: database.name, read: read } end |
#specification ⇒ Hash
Get the specification to pass to the find command operation.
90 91 92 |
# File 'lib/mongo/collection/view/builder/find_command.rb', line 90 def specification { selector: find_command, db_name: database.name, read: read } end |