1{
2 "description": "bulkWrite-update-hint-serverError",
3 "schemaVersion": "1.0",
4 "runOnRequirements": [
5 {
6 "minServerVersion": "3.4.0",
7 "maxServerVersion": "4.1.9"
8 }
9 ],
10 "createEntities": [
11 {
12 "client": {
13 "id": "client0",
14 "observeEvents": [
15 "commandStartedEvent"
16 ]
17 }
18 },
19 {
20 "database": {
21 "id": "database0",
22 "client": "client0",
23 "databaseName": "crud-v2"
24 }
25 },
26 {
27 "collection": {
28 "id": "collection0",
29 "database": "database0",
30 "collectionName": "test_bulkwrite_update_hint"
31 }
32 }
33 ],
34 "initialData": [
35 {
36 "collectionName": "test_bulkwrite_update_hint",
37 "databaseName": "crud-v2",
38 "documents": [
39 {
40 "_id": 1,
41 "x": 11
42 },
43 {
44 "_id": 2,
45 "x": 22
46 },
47 {
48 "_id": 3,
49 "x": 33
50 },
51 {
52 "_id": 4,
53 "x": 44
54 }
55 ]
56 }
57 ],
58 "tests": [
59 {
60 "description": "BulkWrite updateOne with update hints unsupported (server-side error)",
61 "operations": [
62 {
63 "object": "collection0",
64 "name": "bulkWrite",
65 "arguments": {
66 "requests": [
67 {
68 "updateOne": {
69 "filter": {
70 "_id": 1
71 },
72 "update": {
73 "$inc": {
74 "x": 1
75 }
76 },
77 "hint": "_id_"
78 }
79 },
80 {
81 "updateOne": {
82 "filter": {
83 "_id": 1
84 },
85 "update": {
86 "$inc": {
87 "x": 1
88 }
89 },
90 "hint": {
91 "_id": 1
92 }
93 }
94 }
95 ],
96 "ordered": true
97 },
98 "expectError": {
99 "isError": true
100 }
101 }
102 ],
103 "expectEvents": [
104 {
105 "client": "client0",
106 "events": [
107 {
108 "commandStartedEvent": {
109 "command": {
110 "update": "test_bulkwrite_update_hint",
111 "updates": [
112 {
113 "q": {
114 "_id": 1
115 },
116 "u": {
117 "$inc": {
118 "x": 1
119 }
120 },
121 "hint": "_id_",
122 "multi": {
123 "$$unsetOrMatches": false
124 },
125 "upsert": {
126 "$$unsetOrMatches": false
127 }
128 },
129 {
130 "q": {
131 "_id": 1
132 },
133 "u": {
134 "$inc": {
135 "x": 1
136 }
137 },
138 "hint": {
139 "_id": 1
140 },
141 "multi": {
142 "$$unsetOrMatches": false
143 },
144 "upsert": {
145 "$$unsetOrMatches": false
146 }
147 }
148 ],
149 "ordered": true
150 }
151 }
152 }
153 ]
154 }
155 ],
156 "outcome": [
157 {
158 "collectionName": "test_bulkwrite_update_hint",
159 "databaseName": "crud-v2",
160 "documents": [
161 {
162 "_id": 1,
163 "x": 11
164 },
165 {
166 "_id": 2,
167 "x": 22
168 },
169 {
170 "_id": 3,
171 "x": 33
172 },
173 {
174 "_id": 4,
175 "x": 44
176 }
177 ]
178 }
179 ]
180 },
181 {
182 "description": "BulkWrite updateMany with update hints unsupported (server-side error)",
183 "operations": [
184 {
185 "object": "collection0",
186 "name": "bulkWrite",
187 "arguments": {
188 "requests": [
189 {
190 "updateMany": {
191 "filter": {
192 "_id": {
193 "$lt": 3
194 }
195 },
196 "update": {
197 "$inc": {
198 "x": 1
199 }
200 },
201 "hint": "_id_"
202 }
203 },
204 {
205 "updateMany": {
206 "filter": {
207 "_id": {
208 "$lt": 3
209 }
210 },
211 "update": {
212 "$inc": {
213 "x": 1
214 }
215 },
216 "hint": {
217 "_id": 1
218 }
219 }
220 }
221 ],
222 "ordered": true
223 },
224 "expectError": {
225 "isError": true
226 }
227 }
228 ],
229 "expectEvents": [
230 {
231 "client": "client0",
232 "events": [
233 {
234 "commandStartedEvent": {
235 "command": {
236 "update": "test_bulkwrite_update_hint",
237 "updates": [
238 {
239 "q": {
240 "_id": {
241 "$lt": 3
242 }
243 },
244 "u": {
245 "$inc": {
246 "x": 1
247 }
248 },
249 "multi": true,
250 "hint": "_id_",
251 "upsert": {
252 "$$unsetOrMatches": false
253 }
254 },
255 {
256 "q": {
257 "_id": {
258 "$lt": 3
259 }
260 },
261 "u": {
262 "$inc": {
263 "x": 1
264 }
265 },
266 "multi": true,
267 "hint": {
268 "_id": 1
269 },
270 "upsert": {
271 "$$unsetOrMatches": false
272 }
273 }
274 ],
275 "ordered": true
276 }
277 }
278 }
279 ]
280 }
281 ],
282 "outcome": [
283 {
284 "collectionName": "test_bulkwrite_update_hint",
285 "databaseName": "crud-v2",
286 "documents": [
287 {
288 "_id": 1,
289 "x": 11
290 },
291 {
292 "_id": 2,
293 "x": 22
294 },
295 {
296 "_id": 3,
297 "x": 33
298 },
299 {
300 "_id": 4,
301 "x": 44
302 }
303 ]
304 }
305 ]
306 },
307 {
308 "description": "BulkWrite replaceOne with update hints unsupported (server-side error)",
309 "operations": [
310 {
311 "object": "collection0",
312 "name": "bulkWrite",
313 "arguments": {
314 "requests": [
315 {
316 "replaceOne": {
317 "filter": {
318 "_id": 3
319 },
320 "replacement": {
321 "x": 333
322 },
323 "hint": "_id_"
324 }
325 },
326 {
327 "replaceOne": {
328 "filter": {
329 "_id": 4
330 },
331 "replacement": {
332 "x": 444
333 },
334 "hint": {
335 "_id": 1
336 }
337 }
338 }
339 ],
340 "ordered": true
341 },
342 "expectError": {
343 "isError": true
344 }
345 }
346 ],
347 "expectEvents": [
348 {
349 "client": "client0",
350 "events": [
351 {
352 "commandStartedEvent": {
353 "command": {
354 "update": "test_bulkwrite_update_hint",
355 "updates": [
356 {
357 "q": {
358 "_id": 3
359 },
360 "u": {
361 "x": 333
362 },
363 "hint": "_id_",
364 "multi": {
365 "$$unsetOrMatches": false
366 },
367 "upsert": {
368 "$$unsetOrMatches": false
369 }
370 },
371 {
372 "q": {
373 "_id": 4
374 },
375 "u": {
376 "x": 444
377 },
378 "hint": {
379 "_id": 1
380 },
381 "multi": {
382 "$$unsetOrMatches": false
383 },
384 "upsert": {
385 "$$unsetOrMatches": false
386 }
387 }
388 ],
389 "ordered": true
390 }
391 }
392 }
393 ]
394 }
395 ],
396 "outcome": [
397 {
398 "collectionName": "test_bulkwrite_update_hint",
399 "databaseName": "crud-v2",
400 "documents": [
401 {
402 "_id": 1,
403 "x": 11
404 },
405 {
406 "_id": 2,
407 "x": 22
408 },
409 {
410 "_id": 3,
411 "x": 33
412 },
413 {
414 "_id": 4,
415 "x": 44
416 }
417 ]
418 }
419 ]
420 }
421 ]
422}
View as plain text