File tree Expand file tree Collapse file tree 2 files changed +257
-75
lines changed Expand file tree Collapse file tree 2 files changed +257
-75
lines changed Original file line number Diff line number Diff line change 32
32
"database_name" : " crud-tests" ,
33
33
"tests" : [
34
34
{
35
- "description" : " BulkWrite with arrayFilters" ,
35
+ "description" : " BulkWrite updateOne with arrayFilters" ,
36
36
"operations" : [
37
37
{
38
38
"name" : " bulkWrite" ,
53
53
}
54
54
]
55
55
}
56
- },
56
+ }
57
+ ],
58
+ "options" : {
59
+ "ordered" : true
60
+ }
61
+ },
62
+ "result" : {
63
+ "deletedCount" : 0 ,
64
+ "insertedCount" : 0 ,
65
+ "insertedIds" : {},
66
+ "matchedCount" : 1 ,
67
+ "modifiedCount" : 1 ,
68
+ "upsertedCount" : 0 ,
69
+ "upsertedIds" : {}
70
+ }
71
+ }
72
+ ],
73
+ "expectations" : [
74
+ {
75
+ "command_started_event" : {
76
+ "command" : {
77
+ "update" : " test" ,
78
+ "updates" : [
79
+ {
80
+ "q" : {},
81
+ "u" : {
82
+ "$set" : {
83
+ "y.$[i].b" : 2
84
+ }
85
+ },
86
+ "arrayFilters" : [
87
+ {
88
+ "i.b" : 3
89
+ }
90
+ ]
91
+ }
92
+ ],
93
+ "ordered" : true
94
+ },
95
+ "command_name" : " update" ,
96
+ "database_name" : " crud-tests"
97
+ }
98
+ }
99
+ ],
100
+ "outcome" : {
101
+ "collection" : {
102
+ "data" : [
103
+ {
104
+ "_id" : 1 ,
105
+ "y" : [
106
+ {
107
+ "b" : 2
108
+ },
109
+ {
110
+ "b" : 1
111
+ }
112
+ ]
113
+ },
114
+ {
115
+ "_id" : 2 ,
116
+ "y" : [
117
+ {
118
+ "b" : 0
119
+ },
120
+ {
121
+ "b" : 1
122
+ }
123
+ ]
124
+ }
125
+ ]
126
+ }
127
+ }
128
+ },
129
+ {
130
+ "description" : " BulkWrite updateMany with arrayFilters" ,
131
+ "operations" : [
132
+ {
133
+ "name" : " bulkWrite" ,
134
+ "arguments" : {
135
+ "requests" : [
57
136
{
58
137
"name" : " updateMany" ,
59
138
"arguments" : {
79
158
"deletedCount" : 0 ,
80
159
"insertedCount" : 0 ,
81
160
"insertedIds" : {},
82
- "matchedCount" : 3 ,
83
- "modifiedCount" : 3 ,
161
+ "matchedCount" : 2 ,
162
+ "modifiedCount" : 2 ,
84
163
"upsertedCount" : 0 ,
85
164
"upsertedIds" : {}
86
165
}
92
171
"command" : {
93
172
"update" : " test" ,
94
173
"updates" : [
95
- {
96
- "q" : {},
97
- "u" : {
98
- "$set" : {
99
- "y.$[i].b" : 2
100
- }
101
- },
102
- "arrayFilters" : [
103
- {
104
- "i.b" : 3
105
- }
106
- ]
107
- },
108
174
{
109
175
"q" : {},
110
176
"u" : {
134
200
"_id" : 1 ,
135
201
"y" : [
136
202
{
137
- "b" : 2
203
+ "b" : 3
138
204
},
139
205
{
140
206
"b" : 2
You can’t perform that action at this time.
0 commit comments