1step1leap
1step1leap

Reputation: 605

redis-py: How to check if there is ANY key that matches the pattern

What is the cheapest way of checking whether there is at least one key that matches a key glob pattern in Redis? I don't need to know what the key is or how many matching keys there are.

Upvotes: 1

Views: 783

Answers (1)

vishalk169
vishalk169

Reputation: 141

You can use SCAN command to get the details of the key you are looking for. You can find more details on SCAN at: https://redis.io/commands/scan

Upvotes: 1

Related Questions