ascent.persist

Ascent.persist.set

Stores a value persistently

ascent.persist.set(key: string, value: any, expiry?: number): any;
Parameter
Type
Description

Key

String

Identifier that will map to the value

Value

Any

Value to persist

expiry

Number

<optional>

Example

ascent.persist.set("Customer Id","Last Name",15)

ascent.persist.get

Retrieves a Value by Key.

ascent.persist.get(key: String): any;
Parameter
Type
Description

Key

String

accepts a String value

Example

ascent.persist.set("Customer Id")

Ascent.persist.redis.set

Stores a value in Redis

Ascent.persist.redis.set(url: string,key: string, value: any, expiry?: number): any;
Parameter
Type
Description

url

string

Redis server url

key

string

key under which to store

value

any

value to store

expiry?

number

(Optional) expiry time in seconds

Example

ascent.redis.set("","","",10);

ascent.persist.redis.get

Retrieves a value from Redis

ascent.persist.redis.get(url: string,key: string): any;
Parameter
Type
Description

url

string

Redis server url

key

string

key to fetch

Last updated

Was this helpful?