1
1
description : updateWithPipelines
2
+
2
3
schemaVersion : ' 1.0'
4
+
3
5
runOnRequirements :
4
- -
5
- minServerVersion : 4.1.11
6
+ - minServerVersion : 4.1.11
7
+
6
8
createEntities :
7
- -
8
- client :
9
+ - client :
9
10
id : &client0 client0
10
11
observeEvents :
11
12
- commandStartedEvent
12
- -
13
- database :
13
+ - database :
14
14
id : &database0 database0
15
15
client : client0
16
16
databaseName : &database_name crud-tests
17
- -
18
- collection :
17
+ - collection :
19
18
id : &collection0 collection0
20
19
database : database0
21
20
collectionName : &collection_name test
21
+
22
22
initialData :
23
- -
24
- collectionName : *collection_name
23
+ - collectionName : *collection_name
25
24
databaseName : *database_name
26
25
documents :
27
- -
28
- _id : 1
29
- x : 1
30
- ' y ' : 1
31
- t :
32
- u :
33
- v : 1
34
- -
35
- _id : 2
36
- x : 2
37
- ' y ' : 1
26
+ - { _id: 1, x: 1, y: 1, t: { u: { v: 1 } } }
27
+ - { _id: 2, x: 2, y: 1 }
28
+
38
29
tests :
39
30
-
40
31
description : ' UpdateOne using pipelines'
41
32
operations :
42
- -
43
- object : *collection0
33
+ - object : *collection0
44
34
name : updateOne
45
35
arguments :
46
- filter :
47
- _id : 1
36
+ filter : { _id: 1 }
48
37
update :
49
- -
50
- $replaceRoot :
51
- newRoot : $t
52
- -
53
- $addFields :
54
- foo : 1
38
+ - { $replaceRoot: { newRoot: $t } }
39
+ - { $addFields: { foo: 1 } }
55
40
expectResult :
56
41
matchedCount : 1
57
42
modifiedCount : 1
58
43
upsertedCount : 0
59
44
expectEvents :
60
- -
61
- client : *client0
45
+ - client : *client0
62
46
events :
63
- -
64
- commandStartedEvent :
47
+ - commandStartedEvent :
65
48
command :
66
49
update : *collection_name
67
50
updates :
68
- -
69
- q :
70
- _id : 1
51
+ - q : { _id: 1 }
71
52
u :
72
53
- { $replaceRoot: { newRoot: $t } }
73
54
- { $addFields: { foo: 1 } }
@@ -76,49 +57,33 @@ tests:
76
57
commandName : update
77
58
databaseName : *database_name
78
59
outcome :
79
- -
80
- collectionName : *collection_name
60
+ - collectionName : *collection_name
81
61
databaseName : *database_name
82
62
documents :
83
- -
84
- _id : 1
85
- u :
86
- v : 1
87
- foo : 1
88
- -
89
- _id : 2
90
- x : 2
91
- ' y ' : 1
63
+ - { _id: 1, u: { v: 1 }, foo: 1 }
64
+ - { _id: 2, x: 2, y: 1 }
92
65
-
93
66
description : ' UpdateMany using pipelines'
94
67
operations :
95
- -
96
- object : *collection0
68
+ - object : *collection0
97
69
name : updateMany
98
70
arguments :
99
71
filter : { }
100
72
update :
101
- -
102
- $project :
103
- x : 1
104
- -
105
- $addFields :
106
- foo : 1
73
+ - { $project: { x: 1 } }
74
+ - { $addFields: { foo: 1 } }
107
75
expectResult :
108
76
matchedCount : 2
109
77
modifiedCount : 2
110
78
upsertedCount : 0
111
79
expectEvents :
112
- -
113
- client : *client0
80
+ - client : *client0
114
81
events :
115
- -
116
- commandStartedEvent :
82
+ - commandStartedEvent :
117
83
command :
118
84
update : *collection_name
119
85
updates :
120
- -
121
- q : { }
86
+ - q : { }
122
87
u :
123
88
- { $project: { x: 1 } }
124
89
- { $addFields: { foo: 1 } }
@@ -127,99 +92,62 @@ tests:
127
92
commandName : update
128
93
databaseName : *database_name
129
94
outcome :
130
- -
131
- collectionName : *collection_name
95
+ - collectionName : *collection_name
132
96
databaseName : *database_name
133
97
documents :
134
- -
135
- _id : 1
136
- x : 1
137
- foo : 1
138
- -
139
- _id : 2
140
- x : 2
141
- foo : 1
98
+ - { _id: 1, x: 1, foo: 1 }
99
+ - { _id: 2, x: 2, foo: 1 }
142
100
-
143
101
description : ' FindOneAndUpdate using pipelines'
144
102
operations :
145
- -
146
- object : *collection0
103
+ - object : *collection0
147
104
name : findOneAndUpdate
148
105
arguments :
149
- filter :
150
- _id : 1
106
+ filter : { _id: 1 }
151
107
update :
152
- -
153
- $project :
154
- x : 1
155
- -
156
- $addFields :
157
- foo : 1
108
+ - { $project: { x: 1 } }
109
+ - { $addFields: { foo: 1 } }
158
110
expectEvents :
159
- -
160
- client : *client0
111
+ - client : *client0
161
112
events :
162
- -
163
- commandStartedEvent :
113
+ - commandStartedEvent :
164
114
command :
165
115
findAndModify : *collection_name
166
116
update :
167
- -
168
- $project :
169
- x : 1
170
- -
171
- $addFields :
172
- foo : 1
117
+ - { $project: { x: 1 } }
118
+ - { $addFields: { foo: 1 } }
173
119
commandName : findAndModify
174
120
databaseName : *database_name
175
121
outcome :
176
- -
177
- collectionName : *collection_name
122
+ - collectionName : *collection_name
178
123
databaseName : *database_name
179
124
documents :
180
- -
181
- _id : 1
182
- x : 1
183
- foo : 1
184
- -
185
- _id : 2
186
- x : 2
187
- ' y ' : 1
125
+ - { _id: 1, x: 1, foo: 1 }
126
+ - { _id: 2, x: 2, y: 1 }
188
127
-
189
128
description : ' UpdateOne in bulk write using pipelines'
190
129
operations :
191
- -
192
- object : *collection0
130
+ - object : *collection0
193
131
name : bulkWrite
194
132
arguments :
195
133
requests :
196
- -
197
- updateOne :
198
- filter :
199
- _id : 1
134
+ - updateOne :
135
+ filter : { _id: 1 }
200
136
update :
201
- -
202
- $replaceRoot :
203
- newRoot : $t
204
- -
205
- $addFields :
206
- foo : 1
137
+ - { $replaceRoot: { newRoot: $t } }
138
+ - { $addFields: { foo: 1 } }
207
139
expectResult :
208
140
matchedCount : 1
209
141
modifiedCount : 1
210
142
upsertedCount : 0
211
143
expectEvents :
212
- -
213
- client : *client0
144
+ - client : *client0
214
145
events :
215
- -
216
- commandStartedEvent :
146
+ - commandStartedEvent :
217
147
command :
218
148
update : *collection_name
219
149
updates :
220
- -
221
- q :
222
- _id : 1
150
+ - q : { _id: 1 }
223
151
u :
224
152
- { $replaceRoot: { newRoot: $t } }
225
153
- { $addFields: { foo: 1 } }
@@ -228,52 +156,35 @@ tests:
228
156
commandName : update
229
157
databaseName : *database_name
230
158
outcome :
231
- -
232
- collectionName : *collection_name
159
+ - collectionName : *collection_name
233
160
databaseName : *database_name
234
161
documents :
235
- -
236
- _id : 1
237
- u :
238
- v : 1
239
- foo : 1
240
- -
241
- _id : 2
242
- x : 2
243
- ' y ' : 1
162
+ - { _id: 1, u: { v: 1 }, foo: 1 }
163
+ - { _id: 2, x: 2, y: 1 }
244
164
-
245
165
description : ' UpdateMany in bulk write using pipelines'
246
166
operations :
247
- -
248
- object : *collection0
167
+ - object : *collection0
249
168
name : bulkWrite
250
169
arguments :
251
170
requests :
252
- -
253
- updateMany :
171
+ - updateMany :
254
172
filter : { }
255
173
update :
256
- -
257
- $project :
258
- x : 1
259
- -
260
- $addFields :
261
- foo : 1
174
+ - { $project: { x: 1 } }
175
+ - { $addFields: { foo: 1 } }
262
176
expectResult :
263
177
matchedCount : 2
264
178
modifiedCount : 2
265
179
upsertedCount : 0
266
180
expectEvents :
267
- -
268
- client : *client0
181
+ - client : *client0
269
182
events :
270
- -
271
- commandStartedEvent :
183
+ - commandStartedEvent :
272
184
command :
273
185
update : *collection_name
274
186
updates :
275
- -
276
- q : { }
187
+ - q : { }
277
188
u :
278
189
- { $project: { x: 1 } }
279
190
- { $addFields: { foo: 1 } }
@@ -286,11 +197,5 @@ tests:
286
197
collectionName : *collection_name
287
198
databaseName : *database_name
288
199
documents :
289
- -
290
- _id : 1
291
- x : 1
292
- foo : 1
293
- -
294
- _id : 2
295
- x : 2
296
- foo : 1
200
+ - { _id: 1, x: 1, foo: 1 }
201
+ - { _id: 2, x: 2, foo: 1 }
0 commit comments