我正在使用loopback为我的应用程序提供api服务,我尝试更改一些数据的GET请求.
截至目前,查询将获取特定API的所有结果:
People.find({
where: {
'town': 'name of a town'
}
}).$promise
// Promise is fulfilled and people returned
.then(function(results) {
$scope.people = results;
})
// Promise is rejected and error catched
.catch(function(err) {
$scope.errors.PeopleFind = JSON.stringify(err.data.error.message ?
err.data.error.message :
err.data.error.errmsg
);
});
Run Code Online (Sandbox Code Playgroud)
我已经尝试过在where子句中添加单引号或者做类似的事情.find({ where : { town : 'name of a town' }}.无论我把引号放在哪里,结果总是整个包.我如何查询我感兴趣的结果?
提前致谢