| 1 |
{ |
| 2 |
"description": "insertMany", |
| 3 |
"schemaVersion": "1.0", |
| 4 |
"createEntities": [ |
| 5 |
{ |
| 6 |
"client": { |
| 7 |
"id": "client", |
| 8 |
"observeEvents": [ |
| 9 |
"commandStartedEvent", |
| 10 |
"commandSucceededEvent", |
| 11 |
"commandFailedEvent" |
| 12 |
] |
| 13 |
} |
| 14 |
}, |
| 15 |
{ |
| 16 |
"database": { |
| 17 |
"id": "database", |
| 18 |
"client": "client", |
| 19 |
"databaseName": "command-monitoring-tests" |
| 20 |
} |
| 21 |
}, |
| 22 |
{ |
| 23 |
"collection": { |
| 24 |
"id": "collection", |
| 25 |
"database": "database", |
| 26 |
"collectionName": "test" |
| 27 |
} |
| 28 |
} |
| 29 |
], |
| 30 |
"initialData": [ |
| 31 |
{ |
| 32 |
"collectionName": "test", |
| 33 |
"databaseName": "command-monitoring-tests", |
| 34 |
"documents": [ |
| 35 |
{ |
| 36 |
"_id": 1, |
| 37 |
"x": 11 |
| 38 |
} |
| 39 |
] |
| 40 |
} |
| 41 |
], |
| 42 |
"tests": [ |
| 43 |
{ |
| 44 |
"description": "A successful insertMany", |
| 45 |
"operations": [ |
| 46 |
{ |
| 47 |
"name": "insertMany", |
| 48 |
"object": "collection", |
| 49 |
"arguments": { |
| 50 |
"documents": [ |
| 51 |
{ |
| 52 |
"_id": 2, |
| 53 |
"x": 22 |
| 54 |
} |
| 55 |
] |
| 56 |
} |
| 57 |
} |
| 58 |
], |
| 59 |
"expectEvents": [ |
| 60 |
{ |
| 61 |
"client": "client", |
| 62 |
"events": [ |
| 63 |
{ |
| 64 |
"commandStartedEvent": { |
| 65 |
"command": { |
| 66 |
"insert": "test", |
| 67 |
"documents": [ |
| 68 |
{ |
| 69 |
"_id": 2, |
| 70 |
"x": 22 |
| 71 |
} |
| 72 |
], |
| 73 |
"ordered": true |
| 74 |
}, |
| 75 |
"commandName": "insert", |
| 76 |
"databaseName": "command-monitoring-tests" |
| 77 |
} |
| 78 |
}, |
| 79 |
{ |
| 80 |
"commandSucceededEvent": { |
| 81 |
"reply": { |
| 82 |
"ok": 1, |
| 83 |
"n": 1 |
| 84 |
}, |
| 85 |
"commandName": "insert" |
| 86 |
} |
| 87 |
} |
| 88 |
] |
| 89 |
} |
| 90 |
] |
| 91 |
}, |
| 92 |
{ |
| 93 |
"description": "A successful insertMany with write errors", |
| 94 |
"operations": [ |
| 95 |
{ |
| 96 |
"name": "insertMany", |
| 97 |
"object": "collection", |
| 98 |
"arguments": { |
| 99 |
"documents": [ |
| 100 |
{ |
| 101 |
"_id": 1, |
| 102 |
"x": 11 |
| 103 |
} |
| 104 |
] |
| 105 |
}, |
| 106 |
"expectError": { |
| 107 |
"isClientError": false |
| 108 |
} |
| 109 |
} |
| 110 |
], |
| 111 |
"expectEvents": [ |
| 112 |
{ |
| 113 |
"client": "client", |
| 114 |
"events": [ |
| 115 |
{ |
| 116 |
"commandStartedEvent": { |
| 117 |
"command": { |
| 118 |
"insert": "test", |
| 119 |
"documents": [ |
| 120 |
{ |
| 121 |
"_id": 1, |
| 122 |
"x": 11 |
| 123 |
} |
| 124 |
], |
| 125 |
"ordered": true |
| 126 |
}, |
| 127 |
"commandName": "insert", |
| 128 |
"databaseName": "command-monitoring-tests" |
| 129 |
} |
| 130 |
}, |
| 131 |
{ |
| 132 |
"commandSucceededEvent": { |
| 133 |
"reply": { |
| 134 |
"ok": 1, |
| 135 |
"n": 0, |
| 136 |
"writeErrors": { |
| 137 |
"$$type": "array" |
| 138 |
} |
| 139 |
}, |
| 140 |
"commandName": "insert" |
| 141 |
} |
| 142 |
} |
| 143 |
] |
| 144 |
} |
| 145 |
] |
| 146 |
} |
| 147 |
] |
| 148 |
} |