- Redis Basics
- Redis - Home
- Redis - Overview
- Redis - Environment
- Redis - Configuration
- Redis - Data types
- Redis Commands
- Redis - Commands
- Redis - Keys
- Redis - Strings
- Redis - Hashes
- Redis - Lists
- Redis - Sets
- Redis - Sorted Sets
- Redis - HyperLogLog
- Redis - Publish Subscribe
- Redis - Transactions
- Redis - Scripting
- Redis - Connections
- Redis - Server
- Redis Advanced
- Redis - Backup
- Redis - Security
- Redis - Benchmarks
- Redis - Client Connection
- Redis - Pipelining
- Redis - Partitioning
- Redis - Java
- Redis - Php
- Redis Useful Resources
- Redis - Quick Guide
- Redis - Useful Resources
- Redis - Discussion
Redis - List Lpushx Command
Redis LPUSHX command inserts the value at the head of the list stored at the key, only if the key already exists and holds a list.
Return Value
Integer reply, the length of the list after the push operations.
Syntax
Following is the basic syntax of Redis LPUSHX command.
redis 127.0.0.1:6379> LPUSHX KEY_NAME VALUE1.. VALUEN
Example
redis 127.0.0.1:6379> LPUSH list1 "foo" (integer) 1 redis 127.0.0.1:6379> LPUSHX list1 "bar" (integer) 2 redis 127.0.0.1:6379> LPUSHX list2 "bar" (integer) 0 redis 127.0.0.1:6379> LRANGE list1 0 -1 1) "foo" 2) "bar"
redis_lists.htm
Advertisements
To Continue Learning Please Login
Login with Google