You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this._client.SET("key", "value", "NX", (err, reply) => {
console.log(reply); // should print "OK" only on the first call
});
NX is "Only set the key if it does not already exist" flag.
On real Redis we will get "OK" on the first call and null on the second, which is expected as the value was set at the first time and cannot be overwritten. Redis-mock will respond with "OK" on the first call, second and any other afterward which is not correct behavior.
The text was updated successfully, but these errors were encountered:
Example code
NX is "Only set the key if it does not already exist" flag.
On real Redis we will get "OK" on the first call and null on the second, which is expected as the value was set at the first time and cannot be overwritten. Redis-mock will respond with "OK" on the first call, second and any other afterward which is not correct behavior.
The text was updated successfully, but these errors were encountered: