File tree Expand file tree Collapse file tree 2 files changed +117
-20
lines changed
source/command-monitoring/tests/unified Expand file tree Collapse file tree 2 files changed +117
-20
lines changed Original file line number Diff line number Diff line change 123
123
}
124
124
},
125
125
"sort" : {
126
- "_id" : 1
126
+ "x" : -1
127
+ },
128
+ "projection" : {
129
+ "_id" : 0 ,
130
+ "x" : 1
127
131
},
128
132
"skip" : 2 ,
129
133
"comment" : " test" ,
136
140
"maxTimeMS" : 6000 ,
137
141
"min" : {
138
142
"_id" : 0
139
- },
140
- "returnKey" : false ,
141
- "showRecordId" : false
143
+ }
142
144
}
143
145
}
144
146
],
156
158
}
157
159
},
158
160
"sort" : {
159
- "_id" : 1
161
+ "x" : -1
162
+ },
163
+ "projection" : {
164
+ "_id" : 0 ,
165
+ "x" : 1
160
166
},
161
167
"skip" : 2 ,
162
168
"comment" : " test" ,
169
175
"maxTimeMS" : 6000 ,
170
176
"min" : {
171
177
"_id" : 0
172
- },
173
- "returnKey" : false ,
174
- "showRecordId" : false
178
+ }
175
179
},
176
180
"commandName" : " find" ,
177
181
"databaseName" : " command-monitoring-tests"
186
190
"ns" : " command-monitoring-tests.test" ,
187
191
"firstBatch" : [
188
192
{
189
- "_id" : 4 ,
190
- "x" : 44
193
+ "x" : 33
191
194
},
192
195
{
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
195
261
}
196
262
]
197
263
}
Original file line number Diff line number Diff line change @@ -63,31 +63,29 @@ tests:
63
63
object : *collection
64
64
arguments :
65
65
filter : { _id: { $gt: 1 } }
66
- sort : { _id: 1 }
66
+ sort : { x: -1 }
67
+ projection : { _id: 0, x: 1 }
67
68
skip : 2
68
69
comment : " test"
69
70
hint : { _id: 1 }
70
71
max : { _id: 6 }
71
72
maxTimeMS : 6000
72
73
min : { _id: 0 }
73
- returnKey : false
74
- showRecordId : false
75
74
expectEvents :
76
75
- client : *client
77
76
events :
78
77
- commandStartedEvent :
79
78
command :
80
79
find : *collectionName
81
80
filter : { _id: { $gt: 1 } }
82
- sort : { _id: 1 }
81
+ sort : { x: -1 }
82
+ projection : { _id: 0, x: 1 }
83
83
skip : 2
84
84
comment : " test"
85
85
hint : { _id: 1 }
86
86
max : { _id: 6 }
87
87
maxTimeMS : 6000
88
88
min : { _id: 0 }
89
- returnKey : false
90
- showRecordId : false
91
89
commandName : find
92
90
databaseName : *databaseName
93
91
- commandSucceededEvent :
@@ -97,8 +95,41 @@ tests:
97
95
id : 0
98
96
ns : *namespace
99
97
firstBatch :
100
- - { _id: 4, x: 44 }
101
- - { _id: 5, x: 55 }
98
+ - { x: 33 }
99
+ - { x: 22 }
100
+ commandName : find
101
+
102
+ - description : " A successful find with showRecordId and returnKey"
103
+ operations :
104
+ - name : find
105
+ object : *collection
106
+ arguments :
107
+ filter : { }
108
+ sort : { _id: 1 }
109
+ showRecordId : true
110
+ returnKey : true
111
+ expectEvents :
112
+ - client : *client
113
+ events :
114
+ - commandStartedEvent :
115
+ command :
116
+ find : *collectionName
117
+ showRecordId : true
118
+ returnKey : true
119
+ commandName : find
120
+ databaseName : *databaseName
121
+ - commandSucceededEvent :
122
+ reply :
123
+ ok : 1
124
+ cursor :
125
+ id : 0
126
+ ns : *namespace
127
+ firstBatch :
128
+ - { _id: 1 }
129
+ - { _id: 2 }
130
+ - { _id: 3 }
131
+ - { _id: 4 }
132
+ - { _id: 5 }
102
133
commandName : find
103
134
104
135
- description : " A successful find with a getMore"
You can’t perform that action at this time.
0 commit comments