|
| 1 | +{ |
| 2 | + "description": "client bulkWrite updateOne-sort", |
| 3 | + "schemaVersion": "1.4", |
| 4 | + "runOnRequirements": [ |
| 5 | + { |
| 6 | + "minServerVersion": "8.0", |
| 7 | + "serverless": "forbid" |
| 8 | + } |
| 9 | + ], |
| 10 | + "createEntities": [ |
| 11 | + { |
| 12 | + "client": { |
| 13 | + "id": "client0", |
| 14 | + "observeEvents": [ |
| 15 | + "commandStartedEvent", |
| 16 | + "commandSucceededEvent" |
| 17 | + ] |
| 18 | + } |
| 19 | + }, |
| 20 | + { |
| 21 | + "database": { |
| 22 | + "id": "database0", |
| 23 | + "client": "client0", |
| 24 | + "databaseName": "crud-tests" |
| 25 | + } |
| 26 | + }, |
| 27 | + { |
| 28 | + "collection": { |
| 29 | + "id": "collection0", |
| 30 | + "database": "database0", |
| 31 | + "collectionName": "coll0" |
| 32 | + } |
| 33 | + } |
| 34 | + ], |
| 35 | + "initialData": [ |
| 36 | + { |
| 37 | + "collectionName": "coll0", |
| 38 | + "databaseName": "crud-tests", |
| 39 | + "documents": [ |
| 40 | + { |
| 41 | + "_id": 1, |
| 42 | + "x": 11 |
| 43 | + }, |
| 44 | + { |
| 45 | + "_id": 2, |
| 46 | + "x": 22 |
| 47 | + }, |
| 48 | + { |
| 49 | + "_id": 3, |
| 50 | + "x": 33 |
| 51 | + } |
| 52 | + ] |
| 53 | + } |
| 54 | + ], |
| 55 | + "_yamlAnchors": { |
| 56 | + "namespace": "crud-tests.coll0" |
| 57 | + }, |
| 58 | + "tests": [ |
| 59 | + { |
| 60 | + "description": "client bulkWrite replaceOne with sort option", |
| 61 | + "operations": [ |
| 62 | + { |
| 63 | + "object": "client0", |
| 64 | + "name": "clientBulkWrite", |
| 65 | + "arguments": { |
| 66 | + "models": [ |
| 67 | + { |
| 68 | + "replaceOne": { |
| 69 | + "namespace": "crud-tests.coll0", |
| 70 | + "filter": { |
| 71 | + "_id": { |
| 72 | + "$gt": 1 |
| 73 | + } |
| 74 | + }, |
| 75 | + "sort": { |
| 76 | + "_id": -1 |
| 77 | + }, |
| 78 | + "replacement": { |
| 79 | + "x": 1 |
| 80 | + } |
| 81 | + } |
| 82 | + } |
| 83 | + ] |
| 84 | + } |
| 85 | + } |
| 86 | + ], |
| 87 | + "expectEvents": [ |
| 88 | + { |
| 89 | + "client": "client0", |
| 90 | + "events": [ |
| 91 | + { |
| 92 | + "commandStartedEvent": { |
| 93 | + "commandName": "bulkWrite", |
| 94 | + "databaseName": "admin", |
| 95 | + "command": { |
| 96 | + "bulkWrite": 1, |
| 97 | + "ops": [ |
| 98 | + { |
| 99 | + "update": 0, |
| 100 | + "filter": { |
| 101 | + "_id": { |
| 102 | + "$gt": 1 |
| 103 | + } |
| 104 | + }, |
| 105 | + "updateMods": { |
| 106 | + "x": 1 |
| 107 | + }, |
| 108 | + "sort": { |
| 109 | + "_id": -1 |
| 110 | + }, |
| 111 | + "multi": { |
| 112 | + "$$unsetOrMatches": false |
| 113 | + }, |
| 114 | + "upsert": { |
| 115 | + "$$unsetOrMatches": false |
| 116 | + } |
| 117 | + } |
| 118 | + ], |
| 119 | + "nsInfo": [ |
| 120 | + { |
| 121 | + "ns": "crud-tests.coll0" |
| 122 | + } |
| 123 | + ] |
| 124 | + } |
| 125 | + } |
| 126 | + }, |
| 127 | + { |
| 128 | + "commandSucceededEvent": { |
| 129 | + "reply": { |
| 130 | + "ok": 1, |
| 131 | + "nErrors": 0, |
| 132 | + "nMatched": 1, |
| 133 | + "nModified": 1 |
| 134 | + }, |
| 135 | + "commandName": "bulkWrite" |
| 136 | + } |
| 137 | + } |
| 138 | + ] |
| 139 | + } |
| 140 | + ], |
| 141 | + "outcome": [ |
| 142 | + { |
| 143 | + "collectionName": "coll0", |
| 144 | + "databaseName": "crud-tests", |
| 145 | + "documents": [ |
| 146 | + { |
| 147 | + "_id": 1, |
| 148 | + "x": 11 |
| 149 | + }, |
| 150 | + { |
| 151 | + "_id": 2, |
| 152 | + "x": 22 |
| 153 | + }, |
| 154 | + { |
| 155 | + "_id": 3, |
| 156 | + "x": 1 |
| 157 | + } |
| 158 | + ] |
| 159 | + } |
| 160 | + ] |
| 161 | + } |
| 162 | + ] |
| 163 | +} |
0 commit comments