File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -80,8 +80,9 @@ Aggregate.prototype.bind = function (model) {
80
80
*/
81
81
82
82
Aggregate . prototype . append = function ( ) {
83
- var args = utils . args ( arguments )
84
- , arg ;
83
+ var args = ( 1 === arguments . length && util . isArray ( arguments [ 0 ] ) )
84
+ ? arguments [ 0 ]
85
+ : utils . args ( arguments ) ;
85
86
86
87
if ( ! args . every ( isOperator ) ) {
87
88
throw new Error ( "Arguments must be aggregate pipeline operators" ) ;
@@ -265,14 +266,12 @@ Aggregate.prototype.near = function (arg) {
265
266
*/
266
267
267
268
Aggregate . prototype . unwind = function ( ) {
268
- var args = ( 1 === arguments . length && util . isArray ( arguments [ 0 ] ) )
269
- ? arguments [ 0 ]
270
- : utils . args ( arguments ) ;
269
+ var args = utils . args ( arguments ) ;
271
270
272
271
return this . append . apply ( this , args . map ( function ( arg ) {
273
272
return { $unwind : '$' + arg } ;
274
273
} ) ) ;
275
- }
274
+ } ;
276
275
277
276
/**
278
277
* Appends a new $sort operator to this aggregate pipeline.
You can’t perform that action at this time.
0 commit comments