...
1# This file was created automatically using mongodb-spec-converter.
2# Please review the generated file, then remove this notice.
3
4description: bulkWrite-delete-hint
5schemaVersion: '1.0'
6runOnRequirements:
7 -
8 minServerVersion: 4.3.4
9createEntities:
10 -
11 client:
12 id: &client0 client0
13 observeEvents:
14 - commandStartedEvent
15 -
16 database:
17 id: &database0 database0
18 client: client0
19 databaseName: &database_name crud-v2
20 -
21 collection:
22 id: &collection0 collection0
23 database: database0
24 collectionName: &collection_name BulkWrite_delete_hint
25initialData:
26 -
27 collectionName: *collection_name
28 databaseName: *database_name
29 documents:
30 -
31 _id: 1
32 x: 11
33 -
34 _id: 2
35 x: 22
36 -
37 _id: 3
38 x: 33
39 -
40 _id: 4
41 x: 44
42tests:
43 -
44 description: 'BulkWrite deleteOne with hints'
45 operations:
46 -
47 object: *collection0
48 name: bulkWrite
49 arguments:
50 requests:
51 -
52 deleteOne:
53 filter: &deleteOne_filter1
54 _id: 1
55 hint: &hint_string _id_
56 -
57 deleteOne:
58 filter: &deleteOne_filter2
59 _id: 2
60 hint: &hint_doc
61 _id: 1
62 ordered: true
63 expectResult:
64 deletedCount: 2
65 insertedCount: 0
66 insertedIds: { $$unsetOrMatches: {} }
67 matchedCount: 0
68 modifiedCount: 0
69 upsertedCount: 0
70 upsertedIds: { }
71 expectEvents:
72 -
73 client: *client0
74 events:
75 -
76 commandStartedEvent:
77 command:
78 delete: *collection_name
79 deletes:
80 -
81 q: *deleteOne_filter1
82 hint: *hint_string
83 limit: 1
84 -
85 q: *deleteOne_filter2
86 hint: *hint_doc
87 limit: 1
88 ordered: true
89 outcome:
90 -
91 collectionName: *collection_name
92 databaseName: *database_name
93 documents:
94 -
95 _id: 3
96 x: 33
97 -
98 _id: 4
99 x: 44
100 -
101 description: 'BulkWrite deleteMany with hints'
102 operations:
103 -
104 object: *collection0
105 name: bulkWrite
106 arguments:
107 requests:
108 -
109 deleteMany:
110 filter: &deleteMany_filter1
111 _id:
112 $lt: 3
113 hint: *hint_string
114 -
115 deleteMany:
116 filter: &deleteMany_filter2
117 _id:
118 $gte: 4
119 hint: *hint_doc
120 ordered: true
121 expectResult:
122 deletedCount: 3
123 insertedCount: 0
124 insertedIds: { $$unsetOrMatches: {} }
125 matchedCount: 0
126 modifiedCount: 0
127 upsertedCount: 0
128 upsertedIds: { }
129 expectEvents:
130 -
131 client: *client0
132 events:
133 -
134 commandStartedEvent:
135 command:
136 delete: *collection_name
137 deletes:
138 -
139 q: *deleteMany_filter1
140 hint: *hint_string
141 limit: 0
142 -
143 q: *deleteMany_filter2
144 hint: *hint_doc
145 limit: 0
146 ordered: true
147 outcome:
148 -
149 collectionName: *collection_name
150 databaseName: *database_name
151 documents:
152 -
153 _id: 3
154 x: 33
View as plain text