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