【发布时间】:2014-09-17 09:38:34
【问题描述】:
我正在为我的数据库工作使用 NodeJs 的 orm2 模块,但我被困在需要从 MYSQL 中选择不同行的地方。
提前致谢。
【问题讨论】:
我正在为我的数据库工作使用 NodeJs 的 orm2 模块,但我被困在需要从 MYSQL 中选择不同行的地方。
提前致谢。
【问题讨论】:
根据这个pull request,你可以这样做:
Person.aggregate().distinct('country').get(function (err, countries) {
// countries should be an Array like [ 'country1', 'country2', ... ]
});
【讨论】: