2022-11-04 18:08:49 +08:00
|
|
|
|
{
|
|
|
|
|
"schema": {
|
|
|
|
|
"bsonType": "object",
|
|
|
|
|
"required": [],
|
|
|
|
|
"permission": {
|
2023-01-17 22:30:34 +08:00
|
|
|
|
"read": "doc.user_id == auth.uid",
|
2022-11-04 18:08:49 +08:00
|
|
|
|
"create": false,
|
2023-01-17 22:30:34 +08:00
|
|
|
|
"update": "doc.user_id == auth.uid",
|
2022-11-04 18:08:49 +08:00
|
|
|
|
"delete": false
|
|
|
|
|
},
|
|
|
|
|
"properties": {
|
|
|
|
|
"_id": {
|
|
|
|
|
"description": "ID,系统自动生成"
|
|
|
|
|
},
|
|
|
|
|
"id": {
|
|
|
|
|
"description": "会话ID,由会话双方用户的id按一定规律排序后的哈希值",
|
|
|
|
|
"permission": {
|
|
|
|
|
"write": false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"type": {
|
|
|
|
|
"description": "会话类型,区分:群聊和单聊",
|
|
|
|
|
"bsonType": "int",
|
|
|
|
|
"label": "",
|
|
|
|
|
"permission": {
|
|
|
|
|
"write": false
|
|
|
|
|
}
|
|
|
|
|
},
|
2023-01-17 22:30:34 +08:00
|
|
|
|
"user_id": {
|
2022-11-04 18:08:49 +08:00
|
|
|
|
"description": "所属用户id",
|
|
|
|
|
"bsonType": "string",
|
|
|
|
|
"permission": {
|
|
|
|
|
"write": false
|
|
|
|
|
}
|
|
|
|
|
},
|
2023-01-17 22:30:34 +08:00
|
|
|
|
"friend_uid": {
|
|
|
|
|
"description": "对话的好友的用户id",
|
2022-11-04 18:08:49 +08:00
|
|
|
|
"permission": {
|
|
|
|
|
"write": false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"group_id": {
|
|
|
|
|
"description": "对话的群id",
|
|
|
|
|
"permission": {
|
|
|
|
|
"write": false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"unread_count": {
|
|
|
|
|
"description": "未读消息数量",
|
2023-01-17 22:30:34 +08:00
|
|
|
|
"bsonType": "int",
|
|
|
|
|
"defaultValue": 0
|
2022-11-04 18:08:49 +08:00
|
|
|
|
},
|
|
|
|
|
"last_msg_note": {
|
|
|
|
|
"description": "最后一条消息概述(文本消息的前n个字,消息为多媒体时只描述类型)"
|
|
|
|
|
},
|
|
|
|
|
"update_time": {
|
|
|
|
|
"bsonType": "timestamp",
|
2023-01-17 22:30:34 +08:00
|
|
|
|
"description": "最后一次会话时间",
|
|
|
|
|
"defaultValue": {
|
|
|
|
|
"$env": "now"
|
|
|
|
|
}
|
2022-11-04 18:08:49 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2023-11-23 14:57:51 +08:00
|
|
|
|
"index": [
|
|
|
|
|
{
|
|
|
|
|
"IndexName": "id",
|
|
|
|
|
"MgoKeySchema": {
|
|
|
|
|
"MgoIndexKeys": [
|
|
|
|
|
{
|
|
|
|
|
"Name": "id",
|
|
|
|
|
"Direction": "1"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"MgoIsUnique": false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
2022-11-04 18:08:49 +08:00
|
|
|
|
}
|