1{
2 "description": "deleteOne-let",
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": "deleteOne with let option",
45 "runOnRequirements": [
46 {
47 "minServerVersion": "5.0"
48 }
49 ],
50 "operations": [
51 {
52 "name": "deleteOne",
53 "object": "collection0",
54 "arguments": {
55 "filter": {
56 "$expr": {
57 "$eq": [
58 "$_id",
59 "$$id"
60 ]
61 }
62 },
63 "let": {
64 "id": 1
65 }
66 },
67 "expectResult": {
68 "deletedCount": 1
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 "$expr": {
84 "$eq": [
85 "$_id",
86 "$$id"
87 ]
88 }
89 },
90 "limit": 1
91 }
92 ],
93 "let": {
94 "id": 1
95 }
96 }
97 }
98 }
99 ]
100 }
101 ],
102 "outcome": [
103 {
104 "collectionName": "coll0",
105 "databaseName": "crud-tests",
106 "documents": [
107 {
108 "_id": 2
109 }
110 ]
111 }
112 ]
113 },
114 {
115 "description": "deleteOne with let option unsupported (server-side error)",
116 "runOnRequirements": [
117 {
118 "minServerVersion": "3.6.0",
119 "maxServerVersion": "4.4.99"
120 }
121 ],
122 "operations": [
123 {
124 "name": "deleteOne",
125 "object": "collection0",
126 "arguments": {
127 "filter": {
128 "$expr": {
129 "$eq": [
130 "$_id",
131 "$$id"
132 ]
133 }
134 },
135 "let": {
136 "id": 1
137 }
138 },
139 "expectError": {
140 "errorContains": "'delete.let' is an unknown field",
141 "isClientError": false
142 }
143 }
144 ],
145 "expectEvents": [
146 {
147 "client": "client0",
148 "events": [
149 {
150 "commandStartedEvent": {
151 "command": {
152 "delete": "coll0",
153 "deletes": [
154 {
155 "q": {
156 "$expr": {
157 "$eq": [
158 "$_id",
159 "$$id"
160 ]
161 }
162 },
163 "limit": 1
164 }
165 ],
166 "let": {
167 "id": 1
168 }
169 }
170 }
171 }
172 ]
173 }
174 ],
175 "outcome": [
176 {
177 "collectionName": "coll0",
178 "databaseName": "crud-tests",
179 "documents": [
180 {
181 "_id": 1
182 },
183 {
184 "_id": 2
185 }
186 ]
187 }
188 ]
189 }
190 ]
191}
View as plain text