RPUSH command in redis

RPUSH key string

Add the string value to the head (RPUSH) or tail (LPUSH) of the list stored at the key.

Note:

If the key does not exist an empty list is created just before the append operation. If the key exists but is not a List an error is returned.

TIME COMPLEXITY: O(1)

RETURN VALUE: Status code reply

Syntax:

RPUSH key string

Example

redis:6379> RPUSH mykey 100
(integer) 1

Output

1


No comments:

Post a Comment