1***@qq.com
1***@qq.com
  • 发布:2024-02-20 18:12
  • 更新:2024-02-22 15:42
  • 阅读:62

数据表已经关联了foreignKey unicloud-db组件还是报错 未找到主表与副表之间的关联关系

分类:uniCloud

dealer-price-group表结构:

{
"bsonType": "object",
"permission": {
"read": true,
"create": true,
"update": true,
"delete": true
},
"properties": {
"_id": {
"description": "ID,系统自动生成"
},
"goods_id": {
"bsonType": "string",
"description": "商品 id,参考 opendb-mall-goods 表",
"foreignKey": "opendb-mall-goods._id"
},
"edit_date": {
"bsonType": "timestamp",
"description": "最近修改时间",
"defaultValue": {
"$env": "now"
}
}
}
}

opendb-mall-goods 表结构:

{
"bsonType": "object",
"required": ["name"],
"permission": {
"read": true,
"create": false,
"update": false,
"delete": false
},
"properties": {
"_id": {
"description": "存储文档 ID(商品 ID),系统自动生成"
},
"category_id": {
"bsonType": "string",
"description": "分类 id,参考opendb-mall-categories表",
"foreignKey": "opendb-mall-categories._id"
},
"goods_sn": {
"bsonType": "string",
"defaultValue": "",
"description": "商品的唯一货号",
"title": "货号",
"trim": "both"
}
}
}

<unicloud-db  
    ref="udb"  
    collection="dealer-price-group,opendb-mall-goods"  
    :where="where"  
    page-data="replace"  
    :orderby="orderby"  
    :getcount="true"  
    :page-size="options.pageSize"  
    :page-current="options.pageCurrent"  
    v-slot:default="{ data, pagination, loading, error, options }"  
    :options="options"  
    loadtime="manual"  
    @load="onqueryload"  
  >  
  。。。。。  
  </unicloud-db>
2024-02-20 18:12 负责人:无 分享
已邀请:
DCloud_uniCloud_WYQ

DCloud_uniCloud_WYQ

你用的HBuilderX版本是多少?连本地云函数报的错误还是云端云函数报的?

要回复问题请先登录注册