Skip to content

Commit 8a7cd9b

Browse files
vector-of-boolkevinAlbs
authored andcommitted
CDRIVER-4396: Add distinct-comment.json (#1035)
1 parent 270725d commit 8a7cd9b

File tree

1 file changed

+186
-0
lines changed

1 file changed

+186
-0
lines changed
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
{
2+
"description": "distinct-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": "distinct-comment-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": "distinct-comment-tests",
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": "distinct with document comment",
51+
"runOnRequirements": [
52+
{
53+
"minServerVersion": "4.4.14"
54+
}
55+
],
56+
"operations": [
57+
{
58+
"name": "distinct",
59+
"object": "collection0",
60+
"arguments": {
61+
"fieldName": "x",
62+
"filter": {},
63+
"comment": {
64+
"key": "value"
65+
}
66+
},
67+
"expectResult": [
68+
11,
69+
22,
70+
33
71+
]
72+
}
73+
],
74+
"expectEvents": [
75+
{
76+
"client": "client0",
77+
"events": [
78+
{
79+
"commandStartedEvent": {
80+
"command": {
81+
"distinct": "coll0",
82+
"key": "x",
83+
"query": {},
84+
"comment": {
85+
"key": "value"
86+
}
87+
},
88+
"commandName": "distinct",
89+
"databaseName": "distinct-comment-tests"
90+
}
91+
}
92+
]
93+
}
94+
]
95+
},
96+
{
97+
"description": "distinct with string comment",
98+
"runOnRequirements": [
99+
{
100+
"minServerVersion": "4.4.0"
101+
}
102+
],
103+
"operations": [
104+
{
105+
"name": "distinct",
106+
"object": "collection0",
107+
"arguments": {
108+
"fieldName": "x",
109+
"filter": {},
110+
"comment": "comment"
111+
},
112+
"expectResult": [
113+
11,
114+
22,
115+
33
116+
]
117+
}
118+
],
119+
"expectEvents": [
120+
{
121+
"client": "client0",
122+
"events": [
123+
{
124+
"commandStartedEvent": {
125+
"command": {
126+
"distinct": "coll0",
127+
"key": "x",
128+
"query": {},
129+
"comment": "comment"
130+
},
131+
"commandName": "distinct",
132+
"databaseName": "distinct-comment-tests"
133+
}
134+
}
135+
]
136+
}
137+
]
138+
},
139+
{
140+
"description": "distinct with document comment - pre 4.4, server error",
141+
"runOnRequirements": [
142+
{
143+
"minServerVersion": "3.6.0",
144+
"maxServerVersion": "4.4.13"
145+
}
146+
],
147+
"operations": [
148+
{
149+
"name": "distinct",
150+
"object": "collection0",
151+
"arguments": {
152+
"fieldName": "x",
153+
"filter": {},
154+
"comment": {
155+
"key": "value"
156+
}
157+
},
158+
"expectError": {
159+
"isClientError": false
160+
}
161+
}
162+
],
163+
"expectEvents": [
164+
{
165+
"client": "client0",
166+
"events": [
167+
{
168+
"commandStartedEvent": {
169+
"command": {
170+
"distinct": "coll0",
171+
"key": "x",
172+
"query": {},
173+
"comment": {
174+
"key": "value"
175+
}
176+
},
177+
"commandName": "distinct",
178+
"databaseName": "distinct-comment-tests"
179+
}
180+
}
181+
]
182+
}
183+
]
184+
}
185+
]
186+
}

0 commit comments

Comments
 (0)