我试图在环回中实现两个模型和一个到一个模型之间的直接关系,如下所示:
model A {
"properties": {
"cId": {
"type": "number"
}
},
"relations": {
"relatives": {
"type": "hasMany",
"model": "B",
"through": "C",
"foreignKey": "cKey",
"throughKey": "cKey"
}
}
}
model B {
"properties": {
"cId": {
"type": "number"
}
}
}
model C {
"properties": {
"id": {
"type": "number"
}
}
}
相关模型而不是直通模型是否可能包含密钥?
当前的结果是奇怪的(数组嵌套在数组中),因为它在搜索B之前选择了C的每个ID。