Skip to content

Commit d9a5f1c

Browse files
Add missing options
1 parent 5d6289d commit d9a5f1c

File tree

3 files changed

+23
-78
lines changed

3 files changed

+23
-78
lines changed

lib/mongo/collection/view/iterable.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def initial_query_op(session)
162162
let: options[:let],
163163
limit: limit,
164164
allow_disk_use: options[:allow_disk_use],
165+
allow_partial_results: options[:allow_partial_results],
165166
read: read,
166167
read_concern: options[:read_concern] || read_concern,
167168
batch_size: batch_size,

spec/runners/unified/crud_operations.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ def get_find_view(op)
3232
if session = args.use('session')
3333
opts[:session] = entities.get(:session, session)
3434
end
35+
if collation = args.use('collation')
36+
opts[:collation] = collation
37+
end
38+
if args.key?('noCursorTimeout')
39+
opts[:no_cursor_timeout] = args.use('noCursorTimeout')
40+
end
41+
if args.key?('oplogReplay')
42+
opts[:oplog_replay] = args.use('oplogReplay')
43+
end
44+
if args.key?('allowPartialResults')
45+
opts[:allow_partial_results] = args.use('allowPartialResults')
46+
end
3547
req = collection.find(args.use!('filter'), **opts)
3648
if batch_size = args.use('batchSize')
3749
req = req.batch_size(batch_size)

spec/spec_tests/data/crud_unified/find-test-all-options.yml

Lines changed: 10 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ schemaVersion: "1.0"
55
createEntities:
66
- client:
77
id: &client0 client0
8-
useMultipleMongoses: true # ensure cursors pin to a single server
98
observeEvents: [ commandStartedEvent ]
109
- database:
1110
id: &database0 database0
@@ -39,7 +38,7 @@ tests:
3938
- name: find
4039
arguments:
4140
filter: *filter
42-
projection: &projection { _id: 1 }
41+
projection: &projection { _id: 1 }
4342
object: *collection0
4443
expectEvents:
4544
- client: *client0
@@ -124,24 +123,6 @@ tests:
124123
commandName: find
125124
databaseName: *database0Name
126125

127-
- description: "singleBatch"
128-
operations:
129-
- name: find
130-
arguments:
131-
filter: *filter
132-
singleBatch: &singleBatch true
133-
object: *collection0
134-
expectEvents:
135-
- client: *client0
136-
events:
137-
- commandStartedEvent:
138-
command:
139-
find: *collection0Name
140-
filter: *filter
141-
singleBatch: *singleBatch
142-
commandName: find
143-
databaseName: *database0Name
144-
145126
- description: "comment"
146127
operations:
147128
- name: find
@@ -178,30 +159,14 @@ tests:
178159
commandName: find
179160
databaseName: *database0Name
180161

181-
- description: "readConcern"
182-
operations:
183-
- name: find
184-
arguments:
185-
filter: *filter
186-
readConcern: &readConcern { level: "local" }
187-
object: *collection0
188-
expectEvents:
189-
- client: *client0
190-
events:
191-
- commandStartedEvent:
192-
command:
193-
find: *collection0Name
194-
filter: *filter
195-
readConcern: *readConcern
196-
commandName: find
197-
databaseName: *database0Name
198-
199162
- description: "max"
200163
operations:
201164
- name: find
202165
arguments:
203166
filter: *filter
204167
max: &max { _id: 10 }
168+
expectError:
169+
isClientError: false
205170
object: *collection0
206171
expectEvents:
207172
- client: *client0
@@ -219,7 +184,10 @@ tests:
219184
- name: find
220185
arguments:
221186
filter: *filter
222-
min: &min { _id: 10 }
187+
hint: { name: 1 }
188+
min: &min { name: 'John' }
189+
expectError:
190+
isClientError: false
223191
object: *collection0
224192
expectEvents:
225193
- client: *client0
@@ -268,48 +236,12 @@ tests:
268236
commandName: find
269237
databaseName: *database0Name
270238

271-
- description: "tailable"
272-
operations:
273-
- name: find
274-
arguments:
275-
filter: *filter
276-
tailable: &tailable false
277-
object: *collection0
278-
expectEvents:
279-
- client: *client0
280-
events:
281-
- commandStartedEvent:
282-
command:
283-
find: *collection0Name
284-
filter: *filter
285-
tailable: *tailable
286-
commandName: find
287-
databaseName: *database0Name
288-
289-
- description: "awaitData"
290-
operations:
291-
- name: find
292-
arguments:
293-
filter: *filter
294-
awaitData: &awaitData false
295-
object: *collection0
296-
expectEvents:
297-
- client: *client0
298-
events:
299-
- commandStartedEvent:
300-
command:
301-
find: *collection0Name
302-
filter: *filter
303-
awaitData: *awaitData
304-
commandName: find
305-
databaseName: *database0Name
306-
307-
- description: "oplogReply"
239+
- description: "oplogReplay"
308240
operations:
309241
- name: find
310242
arguments:
311243
filter: *filter
312-
oplogReply: &oplogReply false
244+
oplogReplay: &oplogReplay false
313245
object: *collection0
314246
expectEvents:
315247
- client: *client0
@@ -318,7 +250,7 @@ tests:
318250
command:
319251
find: *collection0Name
320252
filter: *filter
321-
oplogReply: *oplogReply
253+
oplogReplay: *oplogReplay
322254
commandName: find
323255
databaseName: *database0Name
324256

0 commit comments

Comments
 (0)