how to execute redis command in shell
It's is simpler to call commands directly, without pipelines:
> redis-cli -n 0 LPUSH mylist "hello"(integer) 1
Be shure that you pass -n
option, it's like mysql use <database>
statement, it's set used database (first index is zero). When you run command from cli redis don't uses default database. To get information about databases which has some keys use command:
> INFO keyspacedb0:keys=4,expires=0,avg_ttl=0
More options here: https://redis.io/topics/rediscli