温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/bun/RedisClient/set
点击访问原文链接

RedisClient.set method | Bun module | Bun

RedisClient.set method | Bun module | BunBuildDocsReferenceGuidesBlogDiscord/Bun/RedisClient/setMset

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/Bun/RedisClient/setMset

method

RedisClient.setset(key: KeyLike,value: KeyLike): Promise'OK'>;

Set key to hold the string value

@param key

The key to set

@param value

The value to set

@returns

Promise that resolves with "OK" on success

set(key: KeyLike,value: KeyLike,ex: 'EX',seconds: number): Promise'OK'>;

Set key to hold the string value with expiration

@param key

The key to set

@param value

The value to set

@param ex

Set the specified expire time, in seconds

@returns

Promise that resolves with "OK" on success

set(key: KeyLike,value: KeyLike,px: 'PX',milliseconds: number): Promise'OK'>;

Set key to hold the string value with expiration

@param key

The key to set

@param value

The value to set

@param px

Set the specified expire time, in milliseconds

@returns

Promise that resolves with "OK" on success

set(key: KeyLike,value: KeyLike,exat: 'EXAT',timestampSeconds: number): Promise'OK'>;

Set key to hold the string value with expiration at a specific Unix timestamp

@param key

The key to set

@param value

The value to set

@param exat

Set the specified Unix time at which the key will expire, in seconds

@returns

Promise that resolves with "OK" on success

set(key: KeyLike,value: KeyLike,pxat: 'PXAT',timestampMilliseconds: number): Promise'OK'>;

Set key to hold the string value with expiration at a specific Unix timestamp

@param key

The key to set

@param value

The value to set

@param pxat

Set the specified Unix time at which the key will expire, in milliseconds

@returns

Promise that resolves with "OK" on success

set(key: KeyLike,value: KeyLike,nx: 'NX'): Promisenull | 'OK'>;

Set key to hold the string value only if key does not exist

@param key

The key to set

@param value

The value to set

@param nx

Only set the key if it does not already exist

@returns

Promise that resolves with "OK" on success, or null if the key already exists

set(key: KeyLike,value: KeyLike,xx: 'XX'): Promisenull | 'OK'>;

Set key to hold the string value only if key already exists

@param key

The key to set

@param value

The value to set

@param xx

Only set the key if it already exists

@returns

Promise that resolves with "OK" on success, or null if the key does not exist

set(key: KeyLike,value: KeyLike,get: 'GET'): Promisenull | string>;

Set key to hold the string value and return the old value

@param key

The key to set

@param value

The value to set

@param get

Return the old string stored at key, or null if key did not exist

@returns

Promise that resolves with the old value, or null if key did not exist

set(key: KeyLike,value: KeyLike,keepttl: 'KEEPTTL'): Promise'OK'>;

Set key to hold the string value and retain the time to live

@param key

The key to set

@param value

The value to set

@param keepttl

Retain the time to live associated with the key

@returns

Promise that resolves with "OK" on success

set(key: KeyLike,value: KeyLike,...options: string[]): Promisenull | string>;

Set key to hold the string value with various options

@param key

The key to set

@param value

The value to set

@param options

Array of options (EX, PX, EXAT, PXAT, NX, XX, KEEPTTL, GET)

@returns

Promise that resolves with "OK" on success, null if NX/XX condition not met, or the old value if GET is specified

Referenced typestype KeyLike = string | ArrayBufferView | Blob

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

RedisClient.set method | Bun module | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for method bun.RedisClient.set | Bun