- 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 Rpush Command
Redis RPUSH command inserts all the specified values at the tail of the list stored at the key. If the key does not exist, it is created as an empty list before performing the push operation. When the key holds a value that is not a list, an error is returned.
Return Value
Integer reply, the length of the list after the push operation.
Syntax
Following is the basic syntax of Redis RPUSH command.
redis 127.0.0.1:6379> RPUSH KEY_NAME VALUE1..VALUEN
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> LRANGE mylist 0 -1 1) "hello" 2) "foo" 3) "bar"
redis_lists.htm
Advertisements