1{
2 "description": "deleteMany-comment",
3 "schemaVersion": "1.0",
4 "createEntities": [
5 {
6 "client": {
7 "id": "client0",
8 "observeEvents": [
9 "commandStartedEvent"
10 ]
11 }
12 },
13 {
14 "database": {
15 "id": "database0",
16 "client": "client0",
17 "databaseName": "crud-tests"
18 }
19 },
20 {
21 "collection": {
22 "id": "collection0",
23 "database": "database0",
24 "collectionName": "coll0"
25 }
26 }
27 ],
28 "initialData": [
29 {
30 "collectionName": "coll0",
31 "databaseName": "crud-tests",
32 "documents": [
33 {
34 "_id": 1
35 },
36 {
37 "_id": 2,
38 "name": "name2"
39 },
40 {
41 "_id": 3,
42 "name": "name3"
43 }
44 ]
45 }
46 ],
47 "tests": [
48 {
49 "description": "deleteMany with string comment",
50 "runOnRequirements": [
51 {
52 "minServerVersion": "4.4"
53 }
54 ],
55 "operations": [
56 {
57 "name": "deleteMany",
58 "object": "collection0",
59 "arguments": {
60 "filter": {
61 "_id": {
62 "$gt": 1
63 }
64 },
65 "comment": "comment"
66 },
67 "expectResult": {
68 "deletedCount": 2
69 }
70 }
71 ],
72 "expectEvents": [
73 {
74 "client": "client0",
75 "events": [
76 {
77 "commandStartedEvent": {
78 "command": {
79 "delete": "coll0",
80 "deletes": [
81 {
82 "q": {
83 "_id": {
84 "$gt": 1
85 }
86 },
87 "limit": 0
88 }
89 ],
90 "comment": "comment"
91 }
92 }
93 }
94 ]
95 }
96 ],
97 "outcome": [
98 {
99 "collectionName": "coll0",
100 "databaseName": "crud-tests",
101 "documents": [
102 {
103 "_id": 1
104 }
105 ]
106 }
107 ]
108 },
109 {
110 "description": "deleteMany with document comment",
111 "runOnRequirements": [
112 {
113 "minServerVersion": "4.4"
114 }
115 ],
116 "operations": [
117 {
118 "name": "deleteMany",
119 "object": "collection0",
120 "arguments": {
121 "filter": {
122 "_id": {
123 "$gt": 1
124 }
125 },
126 "comment": {
127 "key": "value"
128 }
129 },
130 "expectResult": {
131 "deletedCount": 2
132 }
133 }
134 ],
135 "expectEvents": [
136 {
137 "client": "client0",
138 "events": [
139 {
140 "commandStartedEvent": {
141 "command": {
142 "delete": "coll0",
143 "deletes": [
144 {
145 "q": {
146 "_id": {
147 "$gt": 1
148 }
149 },
150 "limit": 0
151 }
152 ],
153 "comment": {
154 "key": "value"
155 }
156 }
157 }
158 }
159 ]
160 }
161 ],
162 "outcome": [
163 {
164 "collectionName": "coll0",
165 "databaseName": "crud-tests",
166 "documents": [
167 {
168 "_id": 1
169 }
170 ]
171 }
172 ]
173 },
174 {
175 "description": "deleteMany with comment - pre 4.4",
176 "runOnRequirements": [
177 {
178 "minServerVersion": "3.4.0",
179 "maxServerVersion": "4.2.99"
180 }
181 ],
182 "operations": [
183 {
184 "name": "deleteMany",
185 "object": "collection0",
186 "arguments": {
187 "filter": {
188 "_id": {
189 "$gt": 1
190 }
191 },
192 "comment": "comment"
193 },
194 "expectError": {
195 "isClientError": false
196 }
197 }
198 ],
199 "expectEvents": [
200 {
201 "client": "client0",
202 "events": [
203 {
204 "commandStartedEvent": {
205 "command": {
206 "delete": "coll0",
207 "deletes": [
208 {
209 "q": {
210 "_id": {
211 "$gt": 1
212 }
213 },
214 "limit": 0
215 }
216 ],
217 "comment": "comment"
218 }
219 }
220 }
221 ]
222 }
223 ],
224 "outcome": [
225 {
226 "collectionName": "coll0",
227 "databaseName": "crud-tests",
228 "documents": [
229 {
230 "_id": 1
231 },
232 {
233 "_id": 2,
234 "name": "name2"
235 },
236 {
237 "_id": 3,
238 "name": "name3"
239 }
240 ]
241 }
242 ]
243 }
244 ]
245}
View as plain text