-
Notifications
You must be signed in to change notification settings - Fork 0
xBIT user schema in mongodb
raye-wang edited this page Jul 10, 2016
·
4 revisions
{
"_id": ObjectId,
"id": String,
"username": String,
"password": String,
"phone": String,
"createOn": Timestamp,
"updateOn": Timestamp,
"userKeys": [
{
"id": String,
"priv": String,
"createOn": Timestamp,
"updateOn": Timestamp,
"effective": Double
}
]
}
- _id: the internal unique id of mongodb.
- id : the unique id of user, distinguish this from _id for readable.
- username:
- password: the password, this field should be encrypted using irreversible encryption algorithm.
- phone: phone number of the user.
- createOn: user registry timestamp.
- updateOn: user information update timestamp.
- userKeys: user key is used as identifier while accessing the user's information or data, each key is an object including fields:
- key : unique id of this key, it should be unique globally.
- priv: the privilege this key is granted. The privilege can be 'read', 'write', 'none'.
- createOn: timestamp of this key created.
- updateOn: timestamp of this key last updated.
- effective: the effective interval of this key.