0
我有一個FollowMap如下迴環關係到同型號
{
"name": "FollowMap",
.
.
.
"relations": {
"follower_acc": {
"type": "belongsTo",
"model": "Account",
"foreignKey": "follower_id"
},
"following_acc": {
"type": "belongsTo",
"model": "Account",
"foreignKey": "following_id"
}
}
}
我想建立一個關係到我的賬戶的模式,這樣我就可以得到一個用戶在隨&下面的列表中,賬戶模型如下;
{
"name": "Account",
.
.
.
"followers": {
"type": "hasMany",
"model": "FollowMap",
"foreignKey": "following_id"
},
"following": {
"type": "hasMany",
"model": "FollowMap",
"foreignKey": "follower_id"
}
}
}
從關係,我可以取然而一個帳戶的追隨者,以下算,我無法獲取這些關係的追蹤者和追蹤帳戶列表。我希望這很清楚。