We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97a51e1 commit c36898dCopy full SHA for c36898d
lib/mongo/protocol/reply.rb
@@ -141,18 +141,21 @@ def command
141
private
142
143
def batch_field
144
- starting_from > 0 ? :nextBatch : :firstBatch
+ starting_from > 0 ? 'nextBatch' : 'firstBatch'
145
end
146
147
def command?
148
!documents.empty? && documents.first.key?('ok')
149
150
151
def find_command
152
- BSON::Document.new(
153
- ok: 1,
154
- cursor: BSON::Document.new(id: cursor_id, batch_field => documents)
155
- )
+ document = BSON::Document.new
+ cursor_document = BSON::Document.new
+ cursor_document.store('id', cursor_id)
+ cursor_document.store(batch_field, documents)
156
+ document.store('ok', 1)
157
+ document.store('cursor', cursor_document)
158
+ document
159
160
161
def op_command
0 commit comments