Reputation: 710
I am using orm2 module of NodeJs for my DB works but i am stuck at the place where i need to select distinct rows from MYSQL.
thanks in advance.
Upvotes: 1
Views: 1012
Reputation: 26805
According to this pull request, you can do:
Person.aggregate().distinct('country').get(function (err, countries) {
// countries should be an Array like [ 'country1', 'country2', ... ]
});
Upvotes: 2