"category_id": {
"bsonType": "string",
"title": "分类",
"description": "分类 id,参考`uni-news-categories`表",
"foreignKey": "opendb-news-categories._id",
"enum": {
"collection": "opendb-news-categories",
"field": "name as text, _id as value"
}
},
collectionList: [
db.collection('opendb-news-articles').getTemp(),
db.collection('opendb-news-categories').getTemp()
],
使用schema2code生成代码,结果分类信息读取不到
{"code":0,"message":"","systemInfo":[],"affectedDocs":1,"data":[{"_id":"6266423a8cc5730001c34854","article_status":0,
"category_id":[{}],
"title":"555","content":"555","excerpt":"5555","comment_status":0,"avatar":"/ddd/ddd.jpg"}],"count":1,"timeCost":402}
如果改成如下代码,是可以正常显示分类信息的
collectionList: 'opendb-news-articles,opendb-news-categories',
d***@126.com (作者)
本地,hbuilderx:3.4.8.20220428-alpha
2022-04-29 08:00
DCloud_uniCloud_WYQ
回复 d***@126.com: 使用同样的版本未能复现,可以把你的项目发我一份吗?还有数据库内的这两个表的数据导出为db_init.json给我一份
2022-05-05 13:42