Rate this page:

put

Copy URL
put(key: 

string

,
value:

string

,
ttl:

number

):

Promise<StorageKey>

Creates a key-value pair. If an already existing key is passed, the method updates its value.
The keys should be unique within a Voximplant application.

Parameters

  • key:

    string

    Key to create/update, up to 200 characters. A key can contain a namespace that is written before a colon, for example, test:1234. Thus, namespace "test" can be used as a pattern in the keys method to find the keys with the same namespace. If no namespace is set, the key itself is considered as namespace

  • value:

    string

    Value for the specified key, up to 2000 characters

  • ttl:

    number

    Key expiry time in seconds. The value is in range of 0..7,776,000 (90 days). The TTL is converted to an expireAt Unix timestamp field as part of the storage object. Note that the pricing is tiered in three day-based pieces: 0-30, 31-60, 61-90. See the details here

Returns