我正在使用Loopback来创建Rest API.需要根据集合中的特定列获取不同的数据.我在下面尝试过,但它不起作用,而下面的代码片段也提取重复数据:
this.app.models.location.find(
{
distinct: ("regionName",
{state: st})
}
,
function(err, location){........}
Run Code Online (Sandbox Code Playgroud)
'RegionName'是'location'集合的属性,我只需要选定状态的数据(state是location集合的另一个属性),由'st'表示.谢谢.
loopbackjs ×1