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