Skip to content

How to flushAll while using a createCluster instance #2446

Open
@egmzy

Description

@egmzy

Description

I'm using createCluster as a client instance to run commands like GET and SET.

const client: RedisClusterType = createCluster(options)

I want to implement a deleteAllKeys function but RedisClusterType doesn't have FLUSHALL.

async deleteAllKeys() {
    return await client.FLUSHALL();
}

The only Info I could find is here in the docs:
https://github.com/redis/node-redis/blob/HEAD/docs/clustering.md

It mentions getSlotMaster() but no explanation on how to use it.
Also the code says it's deprecated and we should use slots() instead, which I couldn't find docs for.

Any idea on how I can approach this?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions