1{
2 "description": "findOneAndDelete-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 }
39 ]
40 }
41 ],
42 "tests": [
43 {
44 "description": "findOneAndDelete with string comment",
45 "runOnRequirements": [
46 {
47 "minServerVersion": "4.4"
48 }
49 ],
50 "operations": [
51 {
52 "name": "findOneAndDelete",
53 "object": "collection0",
54 "arguments": {
55 "filter": {
56 "_id": 1
57 },
58 "comment": "comment"
59 },
60 "expectResult": {
61 "_id": 1
62 }
63 }
64 ],
65 "expectEvents": [
66 {
67 "client": "client0",
68 "events": [
69 {
70 "commandStartedEvent": {
71 "command": {
72 "findAndModify": "coll0",
73 "query": {
74 "_id": 1
75 },
76 "remove": true,
77 "comment": "comment"
78 }
79 }
80 }
81 ]
82 }
83 ],
84 "outcome": [
85 {
86 "collectionName": "coll0",
87 "databaseName": "crud-tests",
88 "documents": [
89 {
90 "_id": 2
91 }
92 ]
93 }
94 ]
95 },
96 {
97 "description": "findOneAndDelete with document comment",
98 "runOnRequirements": [
99 {
100 "minServerVersion": "4.4"
101 }
102 ],
103 "operations": [
104 {
105 "name": "findOneAndDelete",
106 "object": "collection0",
107 "arguments": {
108 "filter": {
109 "_id": 1
110 },
111 "comment": {
112 "key": "value"
113 }
114 },
115 "expectResult": {
116 "_id": 1
117 }
118 }
119 ],
120 "expectEvents": [
121 {
122 "client": "client0",
123 "events": [
124 {
125 "commandStartedEvent": {
126 "command": {
127 "findAndModify": "coll0",
128 "query": {
129 "_id": 1
130 },
131 "remove": true,
132 "comment": {
133 "key": "value"
134 }
135 }
136 }
137 }
138 ]
139 }
140 ],
141 "outcome": [
142 {
143 "collectionName": "coll0",
144 "databaseName": "crud-tests",
145 "documents": [
146 {
147 "_id": 2
148 }
149 ]
150 }
151 ]
152 },
153 {
154 "description": "findOneAndDelete with comment - pre 4.4",
155 "runOnRequirements": [
156 {
157 "minServerVersion": "4.2.0",
158 "maxServerVersion": "4.2.99"
159 }
160 ],
161 "operations": [
162 {
163 "name": "findOneAndDelete",
164 "object": "collection0",
165 "arguments": {
166 "filter": {
167 "_id": 1
168 },
169 "comment": "comment"
170 },
171 "expectError": {
172 "isClientError": false
173 }
174 }
175 ],
176 "expectEvents": [
177 {
178 "client": "client0",
179 "events": [
180 {
181 "commandStartedEvent": {
182 "command": {
183 "findAndModify": "coll0",
184 "query": {
185 "_id": 1
186 },
187 "remove": true,
188 "comment": "comment"
189 }
190 }
191 }
192 ]
193 }
194 ],
195 "outcome": [
196 {
197 "collectionName": "coll0",
198 "databaseName": "crud-tests",
199 "documents": [
200 {
201 "_id": 1
202 },
203 {
204 "_id": 2
205 }
206 ]
207 }
208 ]
209 }
210 ]
211}
View as plain text