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

RedisClient.lmove method | Bun module | Bun

RedisClient.lmove method | Bun module | BunBuildDocsReferenceGuidesBlogDiscord/Bun/RedisClient/lmoveMlmove

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/Bun/RedisClient/lmoveMlmove

method

RedisClient.lmovelmove(source: KeyLike,destination: KeyLike,from: 'LEFT' | 'RIGHT',to: 'LEFT' | 'RIGHT'): Promisenull | string>;

Atomically pop an element from a source list and push it to a destination list

Pops an element from the source list (from LEFT or RIGHT) and pushes it to the destination list (to LEFT or RIGHT).

@param source

The source list key

@param destination

The destination list key

@param from

Direction to pop from source: "LEFT" (head) or "RIGHT" (tail)

@param to

Direction to push to destination: "LEFT" (head) or "RIGHT" (tail)

@returns

Promise that resolves with the element moved, or null if the source list is empty

await redis.lpush("source", "a", "b", "c");
const result1 = await redis.lmove("source", "dest", "LEFT", "RIGHT");
// result1: "c" (popped from head of source, pushed to tail of dest)

const result2 = await redis.lmove("source", "dest", "RIGHT", "LEFT");
// result2: "a" (popped from tail of source, pushed to head of dest)
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.lmove method | Bun module | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for method bun.RedisClient.lmove | Bun