I am just starting out with redis, and I hit my first stumbling block with noSql output; previously all i know is sql server.
I understand the principle that everything is based on core value. but how does this work with ordering, for example:
using hash set:
HMSET users:1 firstname 'james' lastname 'smith' created 'datetime.datatime.now'
Now I assume that you add the second entry, you get the length of the hash set (in this case, we say that its 1 returned the value "x"), then we add another line
HMSET users:x firstname 'john' lastname 'smith' created 'datetime.datatime.now'
How do you get the latest entry? by date? or can you just say "get a record of -1 from hashset"?
Perhaps I suggest using a hashset when sorted sets are more suitable?
I use python if it matters
source share