Skip to content

Conversation

@hallta
Copy link

@hallta hallta commented Sep 25, 2014

I removed the check for aggregates.length as:

  • It iterates over the array, where of .length of will simply skip the aggregates
  • The execution of the method will run as expected if no literal aggregates are supplied

Where, in the example:

db.aggregate({column: "value"}).groupBy('column');

Because there are no aggregates, the method would have originally thrown an exception. However, in this case, aggregates aren't needed (just the group by), where the check prevents the execution and the expected output of this "aggregate" function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant