Skip to content

Commit 152257b

Browse files
authored
DRIVERS-3040: Split updateWithPipelines test file by operation (#1727)
1 parent ccb9816 commit 152257b

12 files changed

+1043
-790
lines changed

source/crud/tests/unified/bulkWrite-updateMany-pipeline.json

Lines changed: 148 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
description: bulkWrite-updateMany-pipeline
2+
3+
schemaVersion: '1.0'
4+
5+
runOnRequirements:
6+
- minServerVersion: 4.1.11
7+
8+
createEntities:
9+
- client:
10+
id: &client0 client0
11+
observeEvents:
12+
- commandStartedEvent
13+
- database:
14+
id: &database0 database0
15+
client: client0
16+
databaseName: &database_name crud-tests
17+
- collection:
18+
id: &collection0 collection0
19+
database: database0
20+
collectionName: &collection_name test
21+
22+
initialData:
23+
- collectionName: *collection_name
24+
databaseName: *database_name
25+
documents:
26+
- { _id: 1, x: 1, y: 1, t: { u: { v: 1 } } }
27+
- { _id: 2, x: 2, y: 1 }
28+
29+
tests:
30+
-
31+
description: 'UpdateMany in bulk write using pipelines'
32+
operations:
33+
- object: *collection0
34+
name: bulkWrite
35+
arguments:
36+
requests:
37+
- updateMany:
38+
filter: { }
39+
update:
40+
- { $project: { x: 1 } }
41+
- { $addFields: { foo: 1 } }
42+
expectResult:
43+
matchedCount: 2
44+
modifiedCount: 2
45+
upsertedCount: 0
46+
expectEvents:
47+
- client: *client0
48+
events:
49+
- commandStartedEvent:
50+
command:
51+
update: *collection_name
52+
updates:
53+
- q: { }
54+
u:
55+
- { $project: { x: 1 } }
56+
- { $addFields: { foo: 1 } }
57+
multi: true
58+
upsert: { $$unsetOrMatches: false }
59+
commandName: update
60+
databaseName: *database_name
61+
outcome:
62+
-
63+
collectionName: *collection_name
64+
databaseName: *database_name
65+
documents:
66+
- { _id: 1, x: 1, foo: 1 }
67+
- { _id: 2, x: 2, foo: 1 }

source/crud/tests/unified/bulkWrite-updateOne-pipeline.json

Lines changed: 156 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)