Redis
  • Intro
  • Contributor
    • Contributor
  • Install
    • Mac OS
    • Windows
  • Connection
    • Redis server / client
      • Configuration
    • Node.js
      • createClient
        • options
  • Concept
    • Book
    • Property
    • Data Type
  • Command
    • DB
      • select
      • flushdb
      • flushall
    • Key
      • del
      • keys
      • exists
      • expire
      • ttl
    • String
      • set & get
      • getrange
      • mget
      • mset
      • strlen
      • append
      • incr & decr
      • setex
      • <Scenario>
    • Hash
      • hset & hget & hdel
      • hgetall & hkeys & hvals
      • hmget & hmset
      • hlen
      • hstrlen
      • hscan
      • hincrby
      • hexists
      • hsetnx
      • <Scenario>
    • List
      • rpush & lpush
      • lrange
      • rpop & lpop
      • brpop & blpop
      • rpushx & lpushx
      • rpoplpush
      • brpoplpush
      • lindex
      • lset
      • linsert
      • llen
      • ltrim
      • lrem
      • <Scenario>
    • Set
      • sadd
      • smembers
      • srandmember
      • spop
      • srem
      • scard
      • sdiff
      • sdiffstore
      • sinter
      • sinterstore
      • sunion
      • sunionstore
      • sismember
      • smove
      • sscan
      • <Scenario>
    • Zset
      • zadd
      • zrange
      • zrevrange
      • zcard
      • zscore
      • zcount
      • zincrby
      • zinterstore
      • zunionstore
      • zrangebyscore
      • zrevrangebyscore
      • zrangebylex
      • zrevrangebylex
      • zlexcount
      • zrank
      • zrevrank
      • zrem
      • zremrangebylex
      • zremrangebyscore
      • zremrangebyrank
      • zscan
      • <Scenario>
  • Reference
    • Reference
Powered by GitBook
On this page

Was this helpful?

  1. Command
  2. List

llen

1. 基本語法

llen(key , callback)

回傳串列長度,key值不存在則回傳0。

client.del('foo');

const foo_list = ['Hello', 'Such', 'A', 'Beautiful', 'World'];
client.rpush('foo', foo_list);
client.llen('foo', redis.print);
Reply: 5

PreviouslinsertNextltrim

Last updated 3 years ago

Was this helpful?