写了分组的结构(组非必填),组的数据如果被删除,联表后管理的字段也是空数组,我想要筛选非空数组的数据,要怎么写呢?
group分组表
{ "bsonType": "object", "required": ["name"], "permission": { "read": true, "create": true, "update": true, "delete": true }, "properties": { "_id": { "description": "ID,系统自动生成" }, "name": { "bsonType": "string", "title": "组名" }, "parent_id": { "bsonType": "string", "description": "上一级目录id", "parentKey": "_id" } } }
data数据表
{ "bsonType": "object", "required": ["stream"], "permission": { "read": true, "create": true, "update": true, "delete": true }, "properties": { "_id": { "description": "ID,系统自动生成" }, "name": { "bsonType": "string", "description": "必须是字符串,并且是必需的", "title": "文件名" }, "state": { "bsonType": "bool", "defaultValue": true, "description": "true代表正常。false代表被删除", "title": "文件状态" }, "group_id": { "bsonType": "string", "title": "所属文件夹", "foreignKey": "group._id", "enumType": "tree", "enum": { "collection": "group", "orderby": "", "field": "_id as value, name as text" } }, "upload_time": { "bsonType": "timestamp", "label": "时间", "forceDefaultValue": { "$env": "now" } } } }
1 个回复
DCloud_uniCloud_WYQ
聚合操作符有个size可以判断数组长度