SET and GET Command
- SET command is used to set the string with key = name and value = “w3wiki”.
- GET command will print the value associated with the key name, which is w3wiki.
Syntax:
SET key = “value”
GET value
Example:
SET name = “Aditya”
GET name
Output:
“Aditya”
Time Complexity of SET and GET Command: O(1)
Complete Guide on Redis Strings
Redis String is a sequence of bytes that can store a sequence of bytes, including text, Object, and binary arrays. which can store a maximum of 512 megabytes in one string. Redis String can also be used like a Redis Key for mapping a string to another string. String Data Types are useful in different types of use cases like caching HTML fragments or different pages.
Important Topics on Redis Strings
- SET and GET Command
- Basic Command Used in String Data Structure in Redis:
- Redis Strings as Counters
- How to manage counters?
- Performance
- Alternatives of String in Redis