Remote Dictionary

The term "dictionary" refers to an associative array data structure.

Associative Array (wikipedia)

This iCloud based dictionary is accessible by SQL table "remote_dictionary", Shortcuts and JavaScript global object iCloudStorage.

Storage Limits

The total amount of space available in your app’s key-value store, for a given user, is 1 MB. There is a per-key value size limit of 1 MB, and a maximum of 1024 keys.

SQL remote_dictionary

SQLite virtual table "remote_dictionary" has the following structure that cannot be altered:

CREATE TABLE remote_dictionary (
    "id" TEXT PRIMARY KEY,
    "value" TEXT
)

JS iCloudStorage

JavaScript iCloudStorage object follows the Storage type of localStorage.

Instance properties Description
length (read only) Returns an integer representing the number of data items stored in the Storage object
Instance methods Description
key(n) When passed a number n, this method will return the name of the nth key in the storage
getItem(keyname) When passed a key name, will return that key's value
setItem(keyname,value) When passed a key name and value, will add that key to the storage, or update that key's value if it already exists
removeItem(keyname) When passed a key name, will remove that key from the storage
clear() When invoked, will empty all keys out of the storage