Private save slots.
Categories > Firebase > rex_firebase_savedataIntroductionLinksDependenceUsageData structure on firebaseSaveLoadFlow chart of load headersFlow chart of load bodyCleanDebug panelSecurity
<sub-domain>\ <UserID> headers\ <slotName> <key> - value bodies\ <slotName> <key> - value
Each user has a private slots set
Each slot has
Header
Body
Action:Set owner
Prepare slot
Action:Set value
Key
supports dot-notation. For example, set pos.x
to 10
to update header or body with xxxxxxxxxx
{
"pos":{
"x": 10
}
}
Action:Set boolean value
Action:Set JSON
Action:Remove key
Action:Save
Callback
Success : Condition:On save
Failed : Condition:On save error
Expression:LastErrorMessage
, Expression:LastErrorCode
Action:Set owner
Read headers, optional
Action:Get all headers
Callback
Success : Condition:On get headers
Expression:HeaderValue(slotName, key)
, returns a value
Expression:HeaderValue(slotName, key, defaultValue)
Expression:HeadersToJSON
, returns a header in JSON string
Expression:HeaderValue(slotName)
Condition:For each header
, retrieves each header
Expression:CurSlotName
Expression:CurHeaderValue(key)
Expression:CurHeaderValue(key, defaultValue)
Condition:For each key
, in Load - header category, retrieves each key in a header
Expression:CurKey
Expression:CurValue
Slot
Condition:All slots are empty
, returns true if no slot is usedCondition:Slot is occupied
, returns true if a slot is usedFailed : Condition:On get headers error
Expression:LastErrorMessage
, Expression:LastErrorCode
Read a body
Action:Get body
Callback
Success :
Body is valid (i.e. not null) : Condition:On get body
Expression:BodyValue(key)
, returns a value
Expression:BodyValue(key, defaultValue)
Expression:BodyToJSON
, returns body in JSON string
Expression:BodyValue
Condition:For each key
, in Load - body category, retrieves each key in a header
Expression:CurKey
Expression:CurValue
Else, Condition:On get unused body
Condition:Body is invalid
, returns trueFailed : Condition:On get body error
Expression:LastErrorMessage
, Expression:LastErrorCode
Action:Set owner
Action:Clean slot
, or Action:Clean all slots
Callback
Success : Condition:On clean
Failed : Condition:On clean error
Expression:LastErrorMessage
, Expression:LastErrorCode
Current loaded headers and loaded body will be presented on debug panel.
Add security rule to make private slots set. (Reference)
Assume that sub domain is save-data
:
xxxxxxxxxx
{
"rules": {
"save-data": {
"$user": {
".read":"auth.uid === $user",
".write":"auth.uid === $user"
}
}
}
}