Skip to content

Commit 51b5d1f

Browse files
committed
PHPLIB-879: Update command monitoring spec tests
Synced with mongodb/specifications@bf372a1
1 parent f2cfb9f commit 51b5d1f

File tree

1 file changed

+78
-12
lines changed
  • tests/UnifiedSpecTests/command-monitoring

1 file changed

+78
-12
lines changed

tests/UnifiedSpecTests/command-monitoring/find.json

Lines changed: 78 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@
123123
}
124124
},
125125
"sort": {
126-
"_id": 1
126+
"x": -1
127+
},
128+
"projection": {
129+
"_id": 0,
130+
"x": 1
127131
},
128132
"skip": 2,
129133
"comment": "test",
@@ -136,9 +140,7 @@
136140
"maxTimeMS": 6000,
137141
"min": {
138142
"_id": 0
139-
},
140-
"returnKey": false,
141-
"showRecordId": false
143+
}
142144
}
143145
}
144146
],
@@ -156,7 +158,11 @@
156158
}
157159
},
158160
"sort": {
159-
"_id": 1
161+
"x": -1
162+
},
163+
"projection": {
164+
"_id": 0,
165+
"x": 1
160166
},
161167
"skip": 2,
162168
"comment": "test",
@@ -169,9 +175,7 @@
169175
"maxTimeMS": 6000,
170176
"min": {
171177
"_id": 0
172-
},
173-
"returnKey": false,
174-
"showRecordId": false
178+
}
175179
},
176180
"commandName": "find",
177181
"databaseName": "command-monitoring-tests"
@@ -186,12 +190,74 @@
186190
"ns": "command-monitoring-tests.test",
187191
"firstBatch": [
188192
{
189-
"_id": 4,
190-
"x": 44
193+
"x": 33
191194
},
192195
{
193-
"_id": 5,
194-
"x": 55
196+
"x": 22
197+
}
198+
]
199+
}
200+
},
201+
"commandName": "find"
202+
}
203+
}
204+
]
205+
}
206+
]
207+
},
208+
{
209+
"description": "A successful find with showRecordId and returnKey",
210+
"operations": [
211+
{
212+
"name": "find",
213+
"object": "collection",
214+
"arguments": {
215+
"filter": {},
216+
"sort": {
217+
"_id": 1
218+
},
219+
"showRecordId": true,
220+
"returnKey": true
221+
}
222+
}
223+
],
224+
"expectEvents": [
225+
{
226+
"client": "client",
227+
"events": [
228+
{
229+
"commandStartedEvent": {
230+
"command": {
231+
"find": "test",
232+
"showRecordId": true,
233+
"returnKey": true
234+
},
235+
"commandName": "find",
236+
"databaseName": "command-monitoring-tests"
237+
}
238+
},
239+
{
240+
"commandSucceededEvent": {
241+
"reply": {
242+
"ok": 1,
243+
"cursor": {
244+
"id": 0,
245+
"ns": "command-monitoring-tests.test",
246+
"firstBatch": [
247+
{
248+
"_id": 1
249+
},
250+
{
251+
"_id": 2
252+
},
253+
{
254+
"_id": 3
255+
},
256+
{
257+
"_id": 4
258+
},
259+
{
260+
"_id": 5
195261
}
196262
]
197263
}

0 commit comments

Comments
 (0)