Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing unnecessary check for aggregates in aggreate().get #557

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

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.

None yet

1 participant