LPUSHS (subquery)

Apply for Redis Developer Course Redis Regular Inspection / Technical Support Redis Enterprise Server

Subquery feature

You can insert values using a subquery in the value part.
Commands that can be used as a subquery are GET, MGET, LPOP, RPOP, LRANGE, SMEMBERS, SUNION, SINTER, SDIFF, ZRANGE, ZREVRANGE, HGET, HMGET, HKEYS, HVALS, HGETALL.

Example

Command>set key Hello
Result>OK
Command>lpushs mylist (get key)
Result>1
Command>lrange mylist 0 -1
Result>1) "Hello"

  • You can insert multiple values using various commands in the subquery.
  • Example

    Command>lpushs mylist (lrange mylist2 0 -1)
    Result>9
    Command>lpushs mylist (sunion myset1 myset2)
    Result>16
    Command>lpushs mylist (zrange myzset1 0 -1)
    Result>22
    Command>lpushs mylist (hmget myhash1 field1 field2)
    Result>24

  • You can use multiple subqueries.
  • Example

    Command>lpushs mylist (lrange mylist2 0 -1)   (sunion myset1 myset2)   value1
    Result>17
    This command is available from Enterprise version 7.2.5 .

    Syntax

    LPUSHS key (subquery)

    • Available since Enterprise version 7.2.5.
    • Time complexity depends on the subquery.

    << LPUSH LPUSH RPOP >>

    Email 답글이 올라오면 이메일로 알려드리겠습니다.