1{
2 "runOn": [
3 {
4 "minServerVersion": "7.0.0",
5 "topology": [
6 "replicaset",
7 "sharded",
8 "load-balanced"
9 ]
10 }
11 ],
12 "database_name": "default",
13 "collection_name": "default",
14 "data": [],
15 "encrypted_fields": {
16 "fields": [
17 {
18 "keyId": {
19 "$binary": {
20 "base64": "EjRWeBI0mHYSNBI0VniQEg==",
21 "subType": "04"
22 }
23 },
24 "path": "encryptedIndexed",
25 "bsonType": "string",
26 "queries": {
27 "queryType": "equality",
28 "contention": {
29 "$numberLong": "0"
30 }
31 }
32 },
33 {
34 "keyId": {
35 "$binary": {
36 "base64": "q83vqxI0mHYSNBI0VniQEg==",
37 "subType": "04"
38 }
39 },
40 "path": "encryptedUnindexed",
41 "bsonType": "string"
42 }
43 ]
44 },
45 "key_vault_data": [
46 {
47 "_id": {
48 "$binary": {
49 "base64": "EjRWeBI0mHYSNBI0VniQEg==",
50 "subType": "04"
51 }
52 },
53 "keyMaterial": {
54 "$binary": {
55 "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==",
56 "subType": "00"
57 }
58 },
59 "creationDate": {
60 "$date": {
61 "$numberLong": "1648914851981"
62 }
63 },
64 "updateDate": {
65 "$date": {
66 "$numberLong": "1648914851981"
67 }
68 },
69 "status": {
70 "$numberInt": "0"
71 },
72 "masterKey": {
73 "provider": "local"
74 }
75 }
76 ],
77 "tests": [
78 {
79 "description": "findOneAndUpdate can query an FLE2 indexed field",
80 "clientOptions": {
81 "autoEncryptOpts": {
82 "kmsProviders": {
83 "local": {
84 "key": {
85 "$binary": {
86 "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk",
87 "subType": "00"
88 }
89 }
90 }
91 }
92 }
93 },
94 "operations": [
95 {
96 "name": "insertOne",
97 "arguments": {
98 "document": {
99 "_id": 1,
100 "encryptedIndexed": "value123"
101 }
102 }
103 },
104 {
105 "name": "findOneAndUpdate",
106 "arguments": {
107 "filter": {
108 "encryptedIndexed": "value123"
109 },
110 "update": {
111 "$set": {
112 "foo": "bar"
113 }
114 },
115 "returnDocument": "Before"
116 },
117 "result": {
118 "_id": 1,
119 "encryptedIndexed": "value123"
120 }
121 }
122 ],
123 "expectations": [
124 {
125 "command_started_event": {
126 "command": {
127 "listCollections": 1,
128 "filter": {
129 "name": "default"
130 }
131 },
132 "command_name": "listCollections"
133 }
134 },
135 {
136 "command_started_event": {
137 "command": {
138 "find": "datakeys",
139 "filter": {
140 "$or": [
141 {
142 "_id": {
143 "$in": [
144 {
145 "$binary": {
146 "base64": "EjRWeBI0mHYSNBI0VniQEg==",
147 "subType": "04"
148 }
149 }
150 ]
151 }
152 },
153 {
154 "keyAltNames": {
155 "$in": []
156 }
157 }
158 ]
159 },
160 "$db": "keyvault",
161 "readConcern": {
162 "level": "majority"
163 }
164 },
165 "command_name": "find"
166 }
167 },
168 {
169 "command_started_event": {
170 "command": {
171 "insert": "default",
172 "documents": [
173 {
174 "_id": 1,
175 "encryptedIndexed": {
176 "$$type": "binData"
177 }
178 }
179 ],
180 "ordered": true,
181 "encryptionInformation": {
182 "type": 1,
183 "schema": {
184 "default.default": {
185 "escCollection": "enxcol_.default.esc",
186 "ecocCollection": "enxcol_.default.ecoc",
187 "fields": [
188 {
189 "keyId": {
190 "$binary": {
191 "base64": "EjRWeBI0mHYSNBI0VniQEg==",
192 "subType": "04"
193 }
194 },
195 "path": "encryptedIndexed",
196 "bsonType": "string",
197 "queries": {
198 "queryType": "equality",
199 "contention": {
200 "$numberLong": "0"
201 }
202 }
203 },
204 {
205 "keyId": {
206 "$binary": {
207 "base64": "q83vqxI0mHYSNBI0VniQEg==",
208 "subType": "04"
209 }
210 },
211 "path": "encryptedUnindexed",
212 "bsonType": "string"
213 }
214 ]
215 }
216 }
217 }
218 },
219 "command_name": "insert"
220 }
221 },
222 {
223 "command_started_event": {
224 "command": {
225 "findAndModify": "default",
226 "query": {
227 "encryptedIndexed": {
228 "$eq": {
229 "$binary": {
230 "base64": "DIkAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVsACAAAAAAaZ9s3G+4znfxStxeOZwcZy1OhzjMGc5hjmdMN+b/w6kSY20AAAAAAAAAAAAA",
231 "subType": "06"
232 }
233 }
234 }
235 },
236 "update": {
237 "$set": {
238 "foo": "bar"
239 }
240 },
241 "encryptionInformation": {
242 "type": 1,
243 "schema": {
244 "default.default": {
245 "escCollection": "enxcol_.default.esc",
246 "ecocCollection": "enxcol_.default.ecoc",
247 "fields": [
248 {
249 "keyId": {
250 "$binary": {
251 "base64": "EjRWeBI0mHYSNBI0VniQEg==",
252 "subType": "04"
253 }
254 },
255 "path": "encryptedIndexed",
256 "bsonType": "string",
257 "queries": {
258 "queryType": "equality",
259 "contention": {
260 "$numberLong": "0"
261 }
262 }
263 },
264 {
265 "keyId": {
266 "$binary": {
267 "base64": "q83vqxI0mHYSNBI0VniQEg==",
268 "subType": "04"
269 }
270 },
271 "path": "encryptedUnindexed",
272 "bsonType": "string"
273 }
274 ]
275 }
276 }
277 }
278 },
279 "command_name": "findAndModify"
280 }
281 }
282 ],
283 "outcome": {
284 "collection": {
285 "data": [
286 {
287 "_id": 1,
288 "encryptedIndexed": {
289 "$$type": "binData"
290 },
291 "foo": "bar",
292 "__safeContent__": [
293 {
294 "$binary": {
295 "base64": "ThpoKfQ8AkOzkFfNC1+9PF0pY2nIzfXvRdxQgjkNbBw=",
296 "subType": "00"
297 }
298 }
299 ]
300 }
301 ]
302 }
303 }
304 },
305 {
306 "description": "findOneAndUpdate can modify an FLE2 indexed field",
307 "clientOptions": {
308 "autoEncryptOpts": {
309 "kmsProviders": {
310 "local": {
311 "key": {
312 "$binary": {
313 "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk",
314 "subType": "00"
315 }
316 }
317 }
318 }
319 }
320 },
321 "operations": [
322 {
323 "name": "insertOne",
324 "arguments": {
325 "document": {
326 "_id": 1,
327 "encryptedIndexed": "value123"
328 }
329 }
330 },
331 {
332 "name": "findOneAndUpdate",
333 "arguments": {
334 "filter": {
335 "encryptedIndexed": "value123"
336 },
337 "update": {
338 "$set": {
339 "encryptedIndexed": "value456"
340 }
341 },
342 "returnDocument": "Before"
343 },
344 "result": {
345 "_id": 1,
346 "encryptedIndexed": "value123"
347 }
348 },
349 {
350 "name": "find",
351 "arguments": {
352 "filter": {
353 "_id": 1
354 }
355 },
356 "result": [
357 {
358 "encryptedIndexed": "value456"
359 }
360 ]
361 }
362 ],
363 "expectations": [
364 {
365 "command_started_event": {
366 "command": {
367 "listCollections": 1,
368 "filter": {
369 "name": "default"
370 }
371 },
372 "command_name": "listCollections"
373 }
374 },
375 {
376 "command_started_event": {
377 "command": {
378 "find": "datakeys",
379 "filter": {
380 "$or": [
381 {
382 "_id": {
383 "$in": [
384 {
385 "$binary": {
386 "base64": "EjRWeBI0mHYSNBI0VniQEg==",
387 "subType": "04"
388 }
389 }
390 ]
391 }
392 },
393 {
394 "keyAltNames": {
395 "$in": []
396 }
397 }
398 ]
399 },
400 "$db": "keyvault",
401 "readConcern": {
402 "level": "majority"
403 }
404 },
405 "command_name": "find"
406 }
407 },
408 {
409 "command_started_event": {
410 "command": {
411 "insert": "default",
412 "documents": [
413 {
414 "_id": 1,
415 "encryptedIndexed": {
416 "$$type": "binData"
417 }
418 }
419 ],
420 "ordered": true,
421 "encryptionInformation": {
422 "type": 1,
423 "schema": {
424 "default.default": {
425 "escCollection": "enxcol_.default.esc",
426 "ecocCollection": "enxcol_.default.ecoc",
427 "fields": [
428 {
429 "keyId": {
430 "$binary": {
431 "base64": "EjRWeBI0mHYSNBI0VniQEg==",
432 "subType": "04"
433 }
434 },
435 "path": "encryptedIndexed",
436 "bsonType": "string",
437 "queries": {
438 "queryType": "equality",
439 "contention": {
440 "$numberLong": "0"
441 }
442 }
443 },
444 {
445 "keyId": {
446 "$binary": {
447 "base64": "q83vqxI0mHYSNBI0VniQEg==",
448 "subType": "04"
449 }
450 },
451 "path": "encryptedUnindexed",
452 "bsonType": "string"
453 }
454 ]
455 }
456 }
457 }
458 },
459 "command_name": "insert"
460 }
461 },
462 {
463 "command_started_event": {
464 "command": {
465 "findAndModify": "default",
466 "query": {
467 "encryptedIndexed": {
468 "$eq": {
469 "$binary": {
470 "base64": "DIkAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVsACAAAAAAaZ9s3G+4znfxStxeOZwcZy1OhzjMGc5hjmdMN+b/w6kSY20AAAAAAAAAAAAA",
471 "subType": "06"
472 }
473 }
474 }
475 },
476 "update": {
477 "$set": {
478 "encryptedIndexed": {
479 "$$type": "binData"
480 }
481 }
482 },
483 "encryptionInformation": {
484 "type": 1,
485 "schema": {
486 "default.default": {
487 "escCollection": "enxcol_.default.esc",
488 "ecocCollection": "enxcol_.default.ecoc",
489 "fields": [
490 {
491 "keyId": {
492 "$binary": {
493 "base64": "EjRWeBI0mHYSNBI0VniQEg==",
494 "subType": "04"
495 }
496 },
497 "path": "encryptedIndexed",
498 "bsonType": "string",
499 "queries": {
500 "queryType": "equality",
501 "contention": {
502 "$numberLong": "0"
503 }
504 }
505 },
506 {
507 "keyId": {
508 "$binary": {
509 "base64": "q83vqxI0mHYSNBI0VniQEg==",
510 "subType": "04"
511 }
512 },
513 "path": "encryptedUnindexed",
514 "bsonType": "string"
515 }
516 ]
517 }
518 }
519 }
520 },
521 "command_name": "findAndModify"
522 }
523 },
524 {
525 "command_started_event": {
526 "command": {
527 "find": "default",
528 "filter": {
529 "_id": {
530 "$eq": 1
531 }
532 }
533 },
534 "command_name": "find"
535 }
536 }
537 ],
538 "outcome": {
539 "collection": {
540 "data": [
541 {
542 "_id": 1,
543 "encryptedIndexed": {
544 "$$type": "binData"
545 },
546 "__safeContent__": [
547 {
548 "$binary": {
549 "base64": "rhe7/w8Ob8Unl44rGr/moScx6m5VODQnscDhF4Nkn6g=",
550 "subType": "00"
551 }
552 }
553 ]
554 }
555 ]
556 }
557 }
558 }
559 ]
560}
View as plain text