Skip to content

Delete multiple keys when using prefix #3605

@NullP0int

Description

@NullP0int

Multiple keys are not deleted when using prefix because the prefix is only added to the first key.

Expected Behavior

Delete all keys.

Current Behavior

Only the first key is deleted.

Possible Solution

Add prefix to every key.

Steps to Reproduce

  1. Create a connection with prefix (e.g. cache)
  2. The following snipped shows the deletion example
var keys []string{"a", "b"}
redis.Del(ctx, keys...)

This will produce the following Redis delete

del cache:a b

But it should be del cache:a cache:b to remove all keys instead of only the first one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions