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

Set accepts params that cause an error in real redis #57

Open
ProdigyTom opened this issue Jun 27, 2018 · 0 comments
Open

Set accepts params that cause an error in real redis #57

ProdigyTom opened this issue Jun 27, 2018 · 0 comments

Comments

@ProdigyTom
Copy link

ProdigyTom commented Jun 27, 2018

We are using redis-mock for our dev environments. I was a bit unfamiliar with how the options worked for the set command and I came up with this:

redis.set(key, value, 'NX', 300);

Which I thought would set the key and expiry time as long as the key didn't already exist. This seems to work with redis-mock just fine. When I moved to the staging environment which uses actual redis I was getting a syntax error from redis. As it turns out what I actually wanted was this:

redis.set(key, value, 'EX', 300, 'NX');

But the issue I see here is that the first call above works in redis-mock but causes a syntax error for real redis. I am using version 0.23.0

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

No branches or pull requests

1 participant