Class: Mongo::Protocol::Delete::Upconverter
- Inherits:
-
Object
- Object
- Mongo::Protocol::Delete::Upconverter
- Defined in:
- build/ruby-driver-master/lib/mongo/protocol/delete.rb
Overview
Converts legacy delete messages to the appropriare OP_COMMAND style message.
Constant Summary collapse
- DELETE =
The delete command constant.
'delete'.freeze
- DELETES =
The deletes command constant.
'deletes'.freeze
Instance Attribute Summary collapse
-
#collection ⇒ String
readonly
Collection The name of the collection.
-
#filter ⇒ BSON::Document, Hash
readonly
Filter The query filter or command.
-
#options ⇒ Hash
readonly
Options The options.
Instance Method Summary collapse
-
#command ⇒ BSON::Document
Get the upconverted command.
-
#initialize(collection, filter, options) ⇒ Upconverter
constructor
Instantiate the upconverter.
Constructor Details
#initialize(collection, filter, options) ⇒ Upconverter
Instantiate the upconverter.
136 137 138 139 140 |
# File 'build/ruby-driver-master/lib/mongo/protocol/delete.rb', line 136 def initialize(collection, filter, ) @collection = collection @filter = filter @options = end |
Instance Attribute Details
#collection ⇒ String (readonly)
Returns collection The name of the collection.
119 120 121 |
# File 'build/ruby-driver-master/lib/mongo/protocol/delete.rb', line 119 def collection @collection end |
#filter ⇒ BSON::Document, Hash (readonly)
Returns filter The query filter or command.
122 123 124 |
# File 'build/ruby-driver-master/lib/mongo/protocol/delete.rb', line 122 def filter @filter end |
#options ⇒ Hash (readonly)
Returns options The options.
125 126 127 |
# File 'build/ruby-driver-master/lib/mongo/protocol/delete.rb', line 125 def @options end |
Instance Method Details
#command ⇒ BSON::Document
Get the upconverted command.
150 151 152 153 154 155 156 |
# File 'build/ruby-driver-master/lib/mongo/protocol/delete.rb', line 150 def command document = BSON::Document.new document.store(DELETE, collection) document.store(DELETES, [ BSON::Document.new(Message::Q => filter, Message::LIMIT => limit) ]) document.store(Message::ORDERED, true) document end |