| 1 |
data: |
| 2 |
- {_id: 1, x: 11} |
| 3 |
- {_id: 2, x: 'ping'} |
| 4 |
minServerVersion: '3.4' |
| 5 |
serverless: 'forbid' |
| 6 |
|
| 7 |
tests: |
| 8 |
- |
| 9 |
description: "FindOneAndReplace when one document matches with collation returning the document after modification" |
| 10 |
operation: |
| 11 |
name: findOneAndReplace |
| 12 |
arguments: |
| 13 |
filter: {x: 'PING'} |
| 14 |
replacement: {x: 'pong'} |
| 15 |
projection: {x: 1, _id: 0} |
| 16 |
returnDocument: After |
| 17 |
sort: {x: 1} |
| 18 |
collation: { locale: 'en_US', strength: 2 } # https://www.mongodb.com/docs/manual/reference/collation/#collation-document |
| 19 |
|
| 20 |
outcome: |
| 21 |
result: {x: 'pong'} |
| 22 |
collection: |
| 23 |
data: |
| 24 |
- {_id: 1, x: 11} |
| 25 |
- {_id: 2, x: 'pong'} |