如何在环回中的单个查找中使用查找和位置

how to use find and where in single find in loopback

我对环回很陌生。我想查找记录及其相关记录。所以我正在使用 include 和 where in find,但它不能正常工作。

这是我的示例代码:

Profile.find({{where: {and : [{xxx : req.param('xx')},{yyy : req.param('yyyy')}]}},{include: ['zzz']}}, function (err, instance) {
if(err){
    console.log('err');
     return ctx.res.send({notValid: "error"});
}
if(instance.length==0){
     return ctx.res.send({notValid: "error"});
}
    ctx.res.send({user: instance});

});

我找到了解决方案。

Profile.find({where: {and : [{xxx : req.param('xxx')},{yyy : req.param('yyy')}]}, include: ['zzz']}, function (err, instance) {
    if(err){
        console.log('err');
         return ctx.res.send({notValid: "error"});
    }
    if(instance.length==0){
         return ctx.res.send({notValid: "error"});
    }
        ctx.res.send({user: instance});

});