CloudDB
Last Updated On 2021-07-16
Version 1MinSDK 7Tutorial Video
Non-visible component that communicates with CloudDB server to store and retrieve information.
Properties
You can set the below properties in the UI part of the builder.
- DefaultRedisServer - it's a string value which is set to blank by default.
- ProjectID - it's a string value which is set to blank by default.
- RedisPort - it's a integer value which is set to 6381 by default.
- RedisServer - it's a string value which is set to default by default.
- Token - it's a string value which is set to blank by default.
- UseSSL - it's a boolean value which is set to true by default.
Block Properties
You can set the below blocks properties in the blocks section of the builder.
ProjectID
Gets the ProjectID for this CloudDB project.
RedisPort
The Redis Server port to use. Defaults to 6381
RedisServer
The Redis Server to use to store data. A setting of "DEFAULT" means that the MIT server will be used.
Methods
You can set the below method blocks in the blocks section of the builder.
AppendValueToList
Append a value to the end of a list atomically. If two devices use this function simultaneously, both will be appended and no data lost.
ClearTag
Remove the tag from CloudDB.
CloudConnected
returns True if we are on the network and will likely be able to connect to the CloudDB server.
GetTagList
Get the list of tags for this application. When complete a "TagList" event will be triggered with the list of known tags.
GetValue
Get the Value for a tag, doesn't return the value but will cause a GotValue event to fire when the value is looked up.
RemoveFirstFromList
Return the first element of a list and atomically remove it. If two devices use this function simultaneously, one will get the first element and the the other will get the second element, or an error if there is no available element. When the element is available, the "FirstRemoved" event will be triggered.
StoreValue
Store a value at a tag.
Events
You can set the below event blocks in the blocks section of the builder.
CloudDBError
Indicates that an error occurred while communicating with the CloudDB Redis server.
DataChanged
Indicates that the data in the CloudDB project has changed. Launches an event with the `tag`
FirstRemoved
Event triggered by the "RemoveFirstFromList" function. The argument "value" is the object that was the first in the list, and which is now removed.
GotValue
Indicates that a
TagList
Event triggered when we have received the list of known tags. Used with the "GetTagList" Function.