3***@qq.com
3***@qq.com
  • 发布:2021-04-25 16:50
  • 更新:2021-04-25 17:19
  • 阅读:705

unicloud-db查询:未在schema内查询到meetinginfo表内userinfo字段的关联关系

分类:uniCloud

meetinginfo表

{  
    "bsonType": "object",  
    "required": [],  
    "permission": {  
        "read": true,  
        "create": true,  
        "update": false,  
        "delete": false  
    },  
    "properties": {  
        "_id": {  
            "description": "ID,系统自动生成"  
        },  
        "meeting_id": {  

        },  
        "uid": {  
            "bsonType": "string",  
            "foreignKey": "userinfo.uid"  
        },  
        "signed": {  

        }  
    }  
}

userinfo表

{  
    "bsonType": "object",  
    "required": [],  
    "permission": {  
        "read": true,  
        "create": true,  
        "update": false,  
        "delete": false  
    },  
    "properties": {  
        "_id": {  
            "description": "ID,系统自动生成"  
        },  
        "uid": {  
            "bsonType": "string"  
        },  
        "nickname": {  
            "bsonType": "string"  
        },  
        "mobile": {  
            "bsonType": "string"  
        }  
    }  
}
<unicloud-db v-slot:default="{data ,loading, error, option}" collection="meetinginfo,userinfo" :where="p_where" field="userinfo{nickname,mobile},signed">  

this.p_where = "meetinginfo.meeting_id==' " + this.model._id+ " ' "  

报错:未在schema内查询到meetinginfo表内userinfo字段的关联关系"

按照教程写的,看不出哪里错了,请问为啥?

2021-04-25 16:50 负责人:无 分享
已邀请:
3***@qq.com

3***@qq.com (作者)

试出来了,官方教程是错的

<unicloud-db v-slot:default="{data, loading, error, options}" collection="order,book" where="'book.title == "三国演义"'" field="book{title,author},quantity">

book{title,author},这里的book不应该是表名,而是建立外键的字段名,希望官方可以好好维护下文档,真的,给别人用至少教程不能有错吧

该问题目前已经被锁定, 无法添加新回复