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