Assume that there is currently a mysql table article structure of
id
title title
info content
tags tag id collection
status status (-1, 0, 1, 2)
atime addition time
utime update time
ptime release time
demand press (Tag/Status) Get articles sorted by (add/update/publish) time
How should the redis table be designed at this time?
The current idea is
string type
article:title:{id}
article:info:{id}
article:tags:{id}
article:status:{id}
article:atime:{id}
article :utime:{id}
article:ptime:{id}
set type
all collections: article:list
store collections separately according to status: article:status:{-1/0/1/2}
store separately according to tags Collection article:tag:{tag_id}
Use something like sort article:tag:1 by article:atime:* to get sorting. Is this design reasonable?
There is another question. When trying to search, use
zrangebylex article:status:0 [f (g
The result is an error
ERR unknown command 'zrangebylex'
What is the reason?
Assume that there is currently a mysql table article structure of
id
title title
info content
tags tag id collection
status status (-1, 0, 1, 2)
atime addition time
utime update time
ptime release time
demand press (Tag/Status) Get articles sorted by (add/update/publish) time
How should the redis table be designed at this time?
The current idea is
string type
article:title:{id}
article:info:{id}
article:tags:{id}
article:status:{id}
article:atime:{id}
article :utime:{id}
article:ptime:{id}
set type
all collections: article:list
store collections separately according to status: article:status:{-1/0/1/2}
store separately according to tags Collection article:tag:{tag_id}
Use something like sort article:tag:1 by article:atime:* to get sorting. Is this design reasonable?
There is another question. When trying to search, use
zrangebylex article:status:0 [f (g
The result is an error
ERR unknown command 'zrangebylex'
What is the reason?
zrangebylex requires redis >= 2.8.9
sort article:tag:1 by article:atime:* This sentence is to get the sorting of article ids with tag 1 by adding time, right? This design works
String type is not recommended as it will cause too many keys