- 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 Rpoplpush Command
Redis RPOPLPUSH command returns and removes the last element (tail) of the list stored at the source, and pushes the element at the first element (head) of the list stored at the destination.
Return Value
String reply, the element being popped and pushed.
Syntax
Following is the basic syntax of Redis RPOPLPUSH command.
redis 127.0.0.1:6379> RPOPLPUSH SOURCE_KEY_NAME DESTINATION_KEY_NAME
Example
redis 127.0.0.1:6379> RPUSH mylist "hello" (integer) 1 redis 127.0.0.1:6379> RPUSH mylist "foo" (integer) 2 redis 127.0.0.1:6379> RPUSH mylist "bar" (integer) 3 redis 127.0.0.1:6379> RPOPLPUSH mylist myotherlist "bar" redis 127.0.0.1:6379> LRANGE mylist 0 -1 1) "hello" 2) "foo"
redis_lists.htm
Advertisements