Skip to content

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

@ProdigyTom

Description

@ProdigyTom

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions