Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRIVERS-2638: Test empty pipelines for update and findAndModify commands #1555

Closed
wants to merge 2 commits into from
Closed
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
198 changes: 198 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.

94 changes: 94 additions & 0 deletions source/crud/tests/unified/bulkWrite-updateMany-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
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 }
-
description: 'UpdateMany in bulk write using empty pipeline'
operations:
- object: *collection0
name: bulkWrite
arguments:
requests:
- updateMany:
filter: { }
update: []
expectResult:
matchedCount: 2
modifiedCount: 0
upsertedCount: 0
expectEvents:
- client: *client0
events:
- commandStartedEvent:
command:
update: *collection_name
updates:
- q: { }
u: []
multi: true
upsert: { $$unsetOrMatches: false }
commandName: update
databaseName: *database_name
Loading
Loading