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

RedisClient.linsert method | Bun module | Bun

RedisClient.linsert method | Bun module | BunBuildDocsReferenceGuidesBlogDiscord/Bun/RedisClient/linsertMlinsert

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/Bun/RedisClient/linsertMlinsert

method

RedisClient.linsertlinsert(key: KeyLike,position: 'BEFORE' | 'AFTER',pivot: KeyLike,element: KeyLike): Promisenumber>;

Insert an element before or after another element in a list

@param key

The list key

@param position

"BEFORE" or "AFTER" to specify where to insert

@param pivot

The pivot element to insert before or after

@param element

The element to insert

@returns

Promise that resolves with the length of the list after insert, -1 if pivot not found, or 0 if key doesn't exist

await redis.lpush("mylist", "World");
await redis.lpush("mylist", "Hello");
await redis.linsert("mylist", "BEFORE", "World", "There");
// List is now: ["Hello", "There", "World"]
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.linsert method | Bun module | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for method bun.RedisClient.linsert | Bun