1
我想引用不同的模式(如這裏discribed:https://loopback.io/doc/en/lb2/Embedded-models-and-relations.html),但由嵌套 ID:迴環referencesMany嵌套的外鍵
{
"name" : "person",
...
"relations": {
"cars": {
"type": "referencesMany",
"model": "car",
"foreignKey": "cars.id"
}
}
人JSON實際上是這樣的:
{
...
cars: [{"id": 1, "name": "car1"}, ...]
}
和車模將是全車詳細信息
我是否必須編寫自己的遠程方法來做到這一點?