xxx.shema.json
{
"bsonType": "object",
"required": ["client_id"],
"permission": {
"read": "auth.uid==doc._id",
"create": true,
"update": "auth.uid==doc._id",
"delete": false
},
"properties": {
"_id": {
"description": "微信Open ID",
"bsonType": "string",
"trim": "both",
"maxLength": 128,
"foreignKey": "account._openid",
"forceDefaultValue": { "$env": "uid" }
},
"client_id": {
"description": "推送ID",
"bsonType": "string",
"trim": "both",
"maxLength": 128
},
"last_login": {
"bsonType": "date",
"description": "最后登陆时间"
}
}
}
客户端代码
uniCloud.database().collection('xxx').add({ _id: openId, client_id: cid })
0 个回复