-
Notifications
You must be signed in to change notification settings - Fork 0
User model and key in MongoDb & Redis
bstsnail edited this page Nov 18, 2016
·
4 revisions
{
id:string,
email:string,
password:string,
keys: [
{
"name": string,
"type": string,
"key": string
}
]
}
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": "example@logicmonitor.com",
"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")