Skip to content

Commit 637b5e4

Browse files
committed
Reformat updateWithPipelines.yml
1 parent a32d445 commit 637b5e4

File tree

1 file changed

+62
-157
lines changed

1 file changed

+62
-157
lines changed
Lines changed: 62 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,54 @@
11
description: updateWithPipelines
2+
23
schemaVersion: '1.0'
4+
35
runOnRequirements:
4-
-
5-
minServerVersion: 4.1.11
6+
- minServerVersion: 4.1.11
7+
68
createEntities:
7-
-
8-
client:
9+
- client:
910
id: &client0 client0
1011
observeEvents:
1112
- commandStartedEvent
12-
-
13-
database:
13+
- database:
1414
id: &database0 database0
1515
client: client0
1616
databaseName: &database_name crud-tests
17-
-
18-
collection:
17+
- collection:
1918
id: &collection0 collection0
2019
database: database0
2120
collectionName: &collection_name test
21+
2222
initialData:
23-
-
24-
collectionName: *collection_name
23+
- collectionName: *collection_name
2524
databaseName: *database_name
2625
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+
3829
tests:
3930
-
4031
description: 'UpdateOne using pipelines'
4132
operations:
42-
-
43-
object: *collection0
33+
- object: *collection0
4434
name: updateOne
4535
arguments:
46-
filter:
47-
_id: 1
36+
filter: { _id: 1 }
4837
update:
49-
-
50-
$replaceRoot:
51-
newRoot: $t
52-
-
53-
$addFields:
54-
foo: 1
38+
- { $replaceRoot: { newRoot: $t } }
39+
- { $addFields: { foo: 1 } }
5540
expectResult:
5641
matchedCount: 1
5742
modifiedCount: 1
5843
upsertedCount: 0
5944
expectEvents:
60-
-
61-
client: *client0
45+
- client: *client0
6246
events:
63-
-
64-
commandStartedEvent:
47+
- commandStartedEvent:
6548
command:
6649
update: *collection_name
6750
updates:
68-
-
69-
q:
70-
_id: 1
51+
- q: { _id: 1 }
7152
u:
7253
- { $replaceRoot: { newRoot: $t } }
7354
- { $addFields: { foo: 1 } }
@@ -76,49 +57,33 @@ tests:
7657
commandName: update
7758
databaseName: *database_name
7859
outcome:
79-
-
80-
collectionName: *collection_name
60+
- collectionName: *collection_name
8161
databaseName: *database_name
8262
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 }
9265
-
9366
description: 'UpdateMany using pipelines'
9467
operations:
95-
-
96-
object: *collection0
68+
- object: *collection0
9769
name: updateMany
9870
arguments:
9971
filter: { }
10072
update:
101-
-
102-
$project:
103-
x: 1
104-
-
105-
$addFields:
106-
foo: 1
73+
- { $project: { x: 1 } }
74+
- { $addFields: { foo: 1 } }
10775
expectResult:
10876
matchedCount: 2
10977
modifiedCount: 2
11078
upsertedCount: 0
11179
expectEvents:
112-
-
113-
client: *client0
80+
- client: *client0
11481
events:
115-
-
116-
commandStartedEvent:
82+
- commandStartedEvent:
11783
command:
11884
update: *collection_name
11985
updates:
120-
-
121-
q: { }
86+
- q: { }
12287
u:
12388
- { $project: { x: 1 } }
12489
- { $addFields: { foo: 1 } }
@@ -127,99 +92,62 @@ tests:
12792
commandName: update
12893
databaseName: *database_name
12994
outcome:
130-
-
131-
collectionName: *collection_name
95+
- collectionName: *collection_name
13296
databaseName: *database_name
13397
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 }
142100
-
143101
description: 'FindOneAndUpdate using pipelines'
144102
operations:
145-
-
146-
object: *collection0
103+
- object: *collection0
147104
name: findOneAndUpdate
148105
arguments:
149-
filter:
150-
_id: 1
106+
filter: { _id: 1 }
151107
update:
152-
-
153-
$project:
154-
x: 1
155-
-
156-
$addFields:
157-
foo: 1
108+
- { $project: { x: 1 } }
109+
- { $addFields: { foo: 1 } }
158110
expectEvents:
159-
-
160-
client: *client0
111+
- client: *client0
161112
events:
162-
-
163-
commandStartedEvent:
113+
- commandStartedEvent:
164114
command:
165115
findAndModify: *collection_name
166116
update:
167-
-
168-
$project:
169-
x: 1
170-
-
171-
$addFields:
172-
foo: 1
117+
- { $project: { x: 1 } }
118+
- { $addFields: { foo: 1 } }
173119
commandName: findAndModify
174120
databaseName: *database_name
175121
outcome:
176-
-
177-
collectionName: *collection_name
122+
- collectionName: *collection_name
178123
databaseName: *database_name
179124
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 }
188127
-
189128
description: 'UpdateOne in bulk write using pipelines'
190129
operations:
191-
-
192-
object: *collection0
130+
- object: *collection0
193131
name: bulkWrite
194132
arguments:
195133
requests:
196-
-
197-
updateOne:
198-
filter:
199-
_id: 1
134+
- updateOne:
135+
filter: { _id: 1 }
200136
update:
201-
-
202-
$replaceRoot:
203-
newRoot: $t
204-
-
205-
$addFields:
206-
foo: 1
137+
- { $replaceRoot: { newRoot: $t } }
138+
- { $addFields: { foo: 1 } }
207139
expectResult:
208140
matchedCount: 1
209141
modifiedCount: 1
210142
upsertedCount: 0
211143
expectEvents:
212-
-
213-
client: *client0
144+
- client: *client0
214145
events:
215-
-
216-
commandStartedEvent:
146+
- commandStartedEvent:
217147
command:
218148
update: *collection_name
219149
updates:
220-
-
221-
q:
222-
_id: 1
150+
- q: { _id: 1 }
223151
u:
224152
- { $replaceRoot: { newRoot: $t } }
225153
- { $addFields: { foo: 1 } }
@@ -228,52 +156,35 @@ tests:
228156
commandName: update
229157
databaseName: *database_name
230158
outcome:
231-
-
232-
collectionName: *collection_name
159+
- collectionName: *collection_name
233160
databaseName: *database_name
234161
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 }
244164
-
245165
description: 'UpdateMany in bulk write using pipelines'
246166
operations:
247-
-
248-
object: *collection0
167+
- object: *collection0
249168
name: bulkWrite
250169
arguments:
251170
requests:
252-
-
253-
updateMany:
171+
- updateMany:
254172
filter: { }
255173
update:
256-
-
257-
$project:
258-
x: 1
259-
-
260-
$addFields:
261-
foo: 1
174+
- { $project: { x: 1 } }
175+
- { $addFields: { foo: 1 } }
262176
expectResult:
263177
matchedCount: 2
264178
modifiedCount: 2
265179
upsertedCount: 0
266180
expectEvents:
267-
-
268-
client: *client0
181+
- client: *client0
269182
events:
270-
-
271-
commandStartedEvent:
183+
- commandStartedEvent:
272184
command:
273185
update: *collection_name
274186
updates:
275-
-
276-
q: { }
187+
- q: { }
277188
u:
278189
- { $project: { x: 1 } }
279190
- { $addFields: { foo: 1 } }
@@ -286,11 +197,5 @@ tests:
286197
collectionName: *collection_name
287198
databaseName: *database_name
288199
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

Comments
 (0)