File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -5,14 +5,27 @@ const defineAspects = require('./operation').defineAspects;
5
5
const CommandOperationV2 = require ( './command_v2' ) ;
6
6
7
7
class EstimatedDocumentCountOperation extends CommandOperationV2 {
8
- constructor ( collection , options ) {
8
+ constructor ( collection , query , options ) {
9
+ if ( typeof options === 'undefined' ) {
10
+ options = query ;
11
+ query = undefined ;
12
+ }
13
+
9
14
super ( collection , options ) ;
10
15
this . collectionName = collection . s . namespace . collection ;
16
+ if ( query ) {
17
+ this . query = query ;
18
+ }
11
19
}
12
20
13
21
execute ( server , callback ) {
14
22
const options = this . options ;
15
23
const cmd = { count : this . collectionName } ;
24
+
25
+ if ( this . query ) {
26
+ cmd . query = this . query ;
27
+ }
28
+
16
29
if ( typeof options . skip === 'number' ) {
17
30
cmd . skip = options . skip ;
18
31
}
You can’t perform that action at this time.
0 commit comments