User model and key in MongoDb & Redis - lm-xbit/monitor-platform GitHub Wiki
Users
{
id:string,
email:string,
password:string,
keys: [
{
"name": string,
"type": string,
"key": string
}
]
}
Users In Redis
In Redis, we only store id and the keys the keys is store Set in redis, the Set name is like xbit_id.
For example the user:
{
"id": "abcd",
"email": "[email protected]",
"password": "xxx",
"keys": [
{
"name": "device1",
"type": "mobile",
"key": "k1"
},
{
"name": "device2",
"type": "mobile",
"key": "k2"
}
]
}
So the data in Redis is
"mobile" -> Set("k1", "k2")