Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

(empty list or set) from redis-cli when run from bash

Tags:

redis

I have 3 dummy keys stored in my local redis server.

redis 127.0.0.1:6379> keys *
1) "key2"
2) "key3"
3) "key1"

When I try to fetch the same results from bash it returns "(empty list or set)" . Why?

$ redis-cli keys *
(empty list or set)
like image 507
Antony Thomas Avatar asked Apr 10 '13 03:04

Antony Thomas


People also ask

How remove data from Redis?

There are two major commands to delete the keys present in Redis: FLUSHDB and FLUSHALL. We can use the Redis CLI to execute these commands. The FLUSHDB command deletes the keys in a database. And the FLUSHALL command deletes all keys in all databases.

Does Redis delete empty sets?

Redis Doesn't Store Empty Sets Or Hashes (And Will Delete Empty Sets And Hashes)

What is nil in Redis?

To answer your second question, (nil) or (empty list or set) is just an interpretation of the client program. In the Redis server, in both cases, the entry has been physically removed, and the associated memory freed.

How do you clean Redis?

The easiest way to clear Redis cache is to use the redis-cli command. Databases in Redis are stored individually. Using the redis-cli command allows you to either clear the keys from all databases, or from a single specified database only.


1 Answers

Awww. Just remembered that '*' has special meaning in bash. So

redis-cli keys \*

works.

Note: Not sure if the community would down vote but leaving this question for some poor soul who may be stuck as I was..

like image 166
Antony Thomas Avatar answered Oct 16 '22 08:10

Antony Thomas