Debian Codegraph @

testdata/crud/v1/write/bulkWrite-arrayFilters.json

raw
1 {
2 "data": [
3 {
4 "_id": 1,
5 "y": [
6 {
7 "b": 3
8 },
9 {
10 "b": 1
11 }
12 ]
13 },
14 {
15 "_id": 2,
16 "y": [
17 {
18 "b": 0
19 },
20 {
21 "b": 1
22 }
23 ]
24 }
25 ],
26 "minServerVersion": "3.5.6",
27 "tests": [
28 {
29 "description": "BulkWrite with arrayFilters",
30 "operation": {
31 "name": "bulkWrite",
32 "arguments": {
33 "requests": [
34 {
35 "name": "updateOne",
36 "arguments": {
37 "filter": {},
38 "update": {
39 "$set": {
40 "y.$[i].b": 2
41 }
42 },
43 "arrayFilters": [
44 {
45 "i.b": 3
46 }
47 ]
48 }
49 },
50 {
51 "name": "updateMany",
52 "arguments": {
53 "filter": {},
54 "update": {
55 "$set": {
56 "y.$[i].b": 2
57 }
58 },
59 "arrayFilters": [
60 {
61 "i.b": 1
62 }
63 ]
64 }
65 }
66 ],
67 "options": {
68 "ordered": true
69 }
70 }
71 },
72 "outcome": {
73 "result": {
74 "deletedCount": 0,
75 "insertedCount": 0,
76 "insertedIds": {},
77 "matchedCount": 3,
78 "modifiedCount": 3,
79 "upsertedCount": 0,
80 "upsertedIds": {}
81 },
82 "collection": {
83 "data": [
84 {
85 "_id": 1,
86 "y": [
87 {
88 "b": 2
89 },
90 {
91 "b": 2
92 }
93 ]
94 },
95 {
96 "_id": 2,
97 "y": [
98 {
99 "b": 0
100 },
101 {
102 "b": 2
103 }
104 ]
105 }
106 ]
107 }
108 }
109 }
110 ]
111 }