
- 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
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Redis - List Llen Command
Redis LLEN command returns the length of the list stored at the key. If the key does not exist, it is interpreted as an empty list and 0 is returned. An error is returned when the value stored at the key is not a list.
Return Value
Integer reply, the length of the list at the key.
Syntax
Following is the basic syntax of Redis LLEN command.
redis 127.0.0.1:6379> LLEN KEY_NAME
Example
redis 127.0.0.1:6379> RPUSH list1 "foo" (integer) 1 redis 127.0.0.1:6379> RPUSH list1 "bar" (integer) 2 redis 127.0.0.1:6379> LLEN list1 (integer) 2
redis_lists.htm
Advertisements