揚鞭定義可以包含JSON引用($ REF),例如:
{"paths": {
"/malts": {
"get": {
"responses": {
"200": {
"schema": {
"$ref": "#/definitions/Malt"
}
}
}
}
}
}
存儲在MongoDB中這個JSON對象似乎工作,但後來在更新時,我得到以下錯誤:
MongoError: The DBRef $ref field must be following by a $id field
這是否真的意味着JSON引用不能被儲存在MongoDB中,因爲蒙戈使用$裁判也爲their internal database reference?
我使用的蒙戈快車(HTTPS的最新版本: //github.com/andzdroid/mongo-express) – pfust75