I'm using Redis to store a bunch of "Foos" in a hash:
foo:<id> => {
name = 'whatever',
status = 'incomplete|complete|removed',
user = <user_id>,
...
}
I want to set up an index so I can pull Foos with a particular status for a particular user. Best thing I've come up with is using sets named like so:
foo:user:<user_id>:status:<status> => [ <foo_id>, <foo_id2>, ... ]
But that seems very clunky, and I'd have to make sure to track the old status and remove it from one set when I change the status, to keep data consistent. Is there a more clever structure I can use here?