When using Redis in order to create a “record” you can create a hash with several fields. For example:
HMSET myhash field1 "Hello" field2 "World"
HMSET myhash2 field1 "Goodbye" field2 "World"
You can retrieve this by knowing the key values, however what I want to know is there any way to retrieve all hashes that have “World” in field2?
There are no indexes in redis, and it doesn’t implement SQL. It’s a key-value store. You provide a key, it gets you a value.
That said, you can implement this by maintaining secondary indexes yourself. For example:
create a record and an index entry
update a record, delete old index entry, create new one
find all records which have “World” in
field2I hope you get the idea.