我正在尝试查询与团队ID字段相关的人员ID。找不到解决方案。
in person.json:
"relations": {
"team": {
"type": "hasMany",
"model": "Team",
"foreignKey": "teamID"
}
}
,其中此字段为:Team.getTeams = async function (uid) {
let ids = await loopback.findModel('Team').find({
where: {
or: [
{ owner: new Object(uid) }
]
},
include: {
relation: 'people',
scope: {
where: { id: uid }
}
},
field: { id: true },
});
let ret = [];
ids.forEach(i => {
ret.push([i.id, i.title]);
});
return ret;
};
regex
这是我要执行的查询:
regex("1.*")