dresende / node-orm2

Object Relational Mapping
http://github.com/dresende/node-orm2
MIT License
3.07k stars 377 forks source link

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

Open hallta opened 9 years ago

hallta commented 9 years ago

I removed the check for aggregates.length as:

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.