I'm trying to use hget and hset in ioredis in my node script, I check the documentation, but can not find how to do it, Any idea how to do it?
Thanks,
This has been answered in the comment, but for future search engine hits, here's a runnable example if you have installed ioredis with npm i ioredis
.
ioredis version used: [email protected]
const ioredis = require('ioredis');
const redis = new ioredis();
redis.hset('foo_key','foo_subkey', 'foo_value');
redis.hget('foo_key', 'foo_subkey').then(function (value) {
console.log(value);
});
redis.quit();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With