@@ -1752,9 +1752,8 @@ var pluginManager = function pluginManager() {
1752
1752
logDbRead . d ( "From connection %j" , countlyDb . _cly_debug ) ;
1753
1753
var cursor = this . _aggregate ( query , options ) ;
1754
1754
cursor . _count = cursor . count ;
1755
- cursor . count = function ( ) {
1756
- arguments . unshift ( query ) ;
1757
- return ob . countDocuments . apply ( ob , arguments ) ;
1755
+ cursor . count = function ( ...countArgs ) {
1756
+ return ob . countDocuments . call ( ob , query , ...countArgs ) ;
1758
1757
} ;
1759
1758
cursor . _toArray = cursor . toArray ;
1760
1759
cursor . toArray = function ( cb ) {
@@ -1802,9 +1801,8 @@ var pluginManager = function pluginManager() {
1802
1801
logDbRead . d ( "From connection %j" , countlyDb . _cly_debug ) ;
1803
1802
var cursor = this . _find ( query , options ) ;
1804
1803
cursor . _count = cursor . count ;
1805
- cursor . count = function ( ) {
1806
- arguments . unshift ( query ) ;
1807
- return ob . countDocuments . apply ( ob , arguments ) ;
1804
+ cursor . count = function ( ...countArgs ) {
1805
+ return ob . countDocuments . call ( ob , query , ...countArgs ) ;
1808
1806
} ;
1809
1807
cursor . _toArray = cursor . toArray ;
1810
1808
cursor . toArray = function ( callback ) {
0 commit comments