Skip to content
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

Using JSON.SET with expiry #36

Open
jatinsandilya opened this issue Aug 8, 2019 · 5 comments
Open

Using JSON.SET with expiry #36

jatinsandilya opened this issue Aug 8, 2019 · 5 comments

Comments

@jatinsandilya
Copy link

Is your feature request related to a problem? Please describe.

As described here RedisJSON/RedisJSON#56. I want to set a json key with some expiry. However, I understand it is not supported by ReJSON directly how could I use go-rejson to solve this? Is this supported ? If not I would be willing to help out. Any pointers would be helpful.

Describe the solution you'd like
A command like JSONSetWithExpiry to set expiry for a JSON Key.

Describe alternatives you've considered
I guess I could accomplish this using the underlying redis client but since I will be using your library, a method like JSONSetWithExpiry would be a nice abstraction.

@jatinsandilya jatinsandilya changed the title Using JSON.SET with expriy Using JSON.SET with expiry Aug 8, 2019
@Shivam010
Copy link
Collaborator

I like the idea, and I think we have to use pipelined transactions, for something like this:

MULTI
JSON.SET foo ...
EXPIRE foo 60
EXEC

What do you propose?
@jats22 @nitishm

@Shivam010
Copy link
Collaborator

Also, if we can try for a generic method to run any command in an external transaction, that would solve the issue and would be much useful.

I don't know how we should do so in a generic way with different clients, but it's worth a discussion.

@jatinsandilya
Copy link
Author

@Shivam010 I really think a generic method would be great! Let me put some thought into it and get back.

@nitishm
Copy link
Owner

nitishm commented Dec 23, 2019

I don't think we want to support this. The Client is supposed to be dumb and should only support what the ReJSON spec provides.

With that said, a generic command to extend the Client is a good idea though. Even if it requires a rewrite we should support this. It is beneficial to support the fundamental features of the client which utilizing the ReJSON features.

@Shivam010
Copy link
Collaborator

Shivam010 commented Dec 23, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants