Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 148 additions & 0 deletions source/crud/tests/unified/bulkWrite-updateMany-pipeline.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 67 additions & 0 deletions source/crud/tests/unified/bulkWrite-updateMany-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
description: bulkWrite-updateMany-pipeline

schemaVersion: '1.0'

runOnRequirements:
- minServerVersion: 4.1.11

createEntities:
- client:
id: &client0 client0
observeEvents:
- commandStartedEvent
- database:
id: &database0 database0
client: client0
databaseName: &database_name crud-tests
- collection:
id: &collection0 collection0
database: database0
collectionName: &collection_name test

initialData:
- collectionName: *collection_name
databaseName: *database_name
documents:
- { _id: 1, x: 1, y: 1, t: { u: { v: 1 } } }
- { _id: 2, x: 2, y: 1 }

tests:
-
description: 'UpdateMany in bulk write using pipelines'
operations:
- object: *collection0
name: bulkWrite
arguments:
requests:
- updateMany:
filter: { }
update:
- { $project: { x: 1 } }
- { $addFields: { foo: 1 } }
expectResult:
matchedCount: 2
modifiedCount: 2
upsertedCount: 0
expectEvents:
- client: *client0
events:
- commandStartedEvent:
command:
update: *collection_name
updates:
- q: { }
u:
- { $project: { x: 1 } }
- { $addFields: { foo: 1 } }
multi: true
upsert: { $$unsetOrMatches: false }
commandName: update
databaseName: *database_name
outcome:
-
collectionName: *collection_name
databaseName: *database_name
documents:
- { _id: 1, x: 1, foo: 1 }
- { _id: 2, x: 2, foo: 1 }
156 changes: 156 additions & 0 deletions source/crud/tests/unified/bulkWrite-updateOne-pipeline.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading