-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create keys with expires #159
Comments
Yep! |
Thanks @luin! Would it make sense to add this example to README? If you like I can create a PR :) |
That would be great :-). ioredis just passes all arguments directly to the redis server |
Done! #160 :) |
I'm receiving an error trying to set key with expires redis.set('key', 100, 'ex', 10); Unhandled rejection ReplyError: ERR wrong number of arguments for 'set' command |
@wesleymilan You should run a redis server > 2.6.12 in order to support |
@luin Please add this to the API documentation. |
@aalexgabi do you mean adding a note about |
You can also use this dedicated command http://redis.io/commands/SETEX ;) |
TL;DR Method signatures should be documented. Disclaimer: Maybe I didn't see the part of documentation that talks about this when I "scanned" it. I didn't read the entire page. I mainly used mouse scroll and Ctrl + F (searched for "set", "ex", "command", "commands"). @luin @dirkbonhomme I would like to see explicit documentation on the existence of the There is no reference of the set method (or any other Redis command) here: https://github.com/luin/ioredis/blob/master/API.md#new_Redis I knew the It wasn't obvious to me what arguments the set command can take: I was wondering if it would be like This would also reduce probability of issues like #159. |
I just saw the commit in #160. that added:
I didn't see that in README. |
@aalexgabi I agree with you that the api documentation should be more informative. As noted in README, all arguments are passed directly to the redis server, so that ioredis supports every command / option that your redis server supports. Given people may run different versions of redis servers, the commands / options may differ, so it's a little hard to document them clearly. However, I think some examples do help, and it's also better to note how to pass options like |
@luin I agree with you on having generic documentation for all versions of Redis. I suggest adding something like:
In the table of contents and as a section in the API documentation. |
+1 on document for the instance methods signature |
@luin , Just wanted to know is there a way to expire hash similar to set. For example let sample = { |
@arankhem no, you'll have to do it with 2 commands:
|
@dirkbonhomme ok thank you. |
please can we get these awesome examples in the readme @dirkbonhomme and the op have two wildly different examples. |
This does not work at 2020 Feb |
works in lowercase 'ex' |
But what about hmset when you put the data inside of hash table, for example when you use redis.hmset('myHashTable', 'myKey', 'myData) |
Hi,
Is it poissible to send this Redis command with
ioredis
in just one function call?The text was updated successfully, but these errors were encountered: