| 1 |
data: |
| 2 |
- {_id: 1, x: 11} |
| 3 |
- {_id: 2, x: 'ping'} |
| 4 |
- {_id: 3, x: 'pINg'} |
| 5 |
minServerVersion: '3.4' |
| 6 |
serverless: 'forbid' |
| 7 |
|
| 8 |
tests: |
| 9 |
- |
| 10 |
description: "FindOneAndUpdate when many documents match with collation returning the document before modification" |
| 11 |
operation: |
| 12 |
name: findOneAndUpdate |
| 13 |
arguments: |
| 14 |
filter: |
| 15 |
x: 'PING' |
| 16 |
update: |
| 17 |
$set: {x: 'pong'} |
| 18 |
projection: {x: 1, _id: 0} |
| 19 |
sort: {_id: 1} |
| 20 |
collation: { locale: 'en_US', strength: 2 } # https://www.mongodb.com/docs/manual/reference/collation/#collation-document |
| 21 |
|
| 22 |
outcome: |
| 23 |
result: {x: 'ping'} |
| 24 |
collection: |
| 25 |
data: |
| 26 |
- {_id: 1, x: 11} |
| 27 |
- {_id: 2, x: 'pong'} |
| 28 |
- {_id: 3, x: 'pINg'} |