Skip to content

Comment on Redis explainedparent

Comments

Numbers in redis can be natively represented using BITFIELDS.

BITFIELD player:1:stats SET u32 #0 1000

1) (integer) 0

BITFIELD player:1:stats INCRBY u32 #0 -900

1) (integer) 100

BITFIELD player:1:stats GET u32 #0

1) (integer) 100

OK, that's helpful thank you.

That said, all the keys themselves are still strings and therefore you can't have a SET of numbers or bitfields.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.