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

hset stores object as JSON instead of object.toString() #52

Open
LasTshaMAN opened this issue Oct 7, 2016 · 0 comments
Open

hset stores object as JSON instead of object.toString() #52

LasTshaMAN opened this issue Oct 7, 2016 · 0 comments

Comments

@LasTshaMAN
Copy link

I'm using redis-mock to write integration tests with Redis. In fact, I run two integration tests: one with real Redis client and another one with redis-mock.

When I try to do something like this:
redisClient.hset(collection_name, key, myJsonObject, callback);
I get discrepancies in the behavior between real Redis and redis-mock.

Namely, real Redis client converts my myJsonObject to string representation by calling myJsonObject.toString() while redis-mock client stores myJsonObject as an original JSON/JavaScript object.
So, when I retrieve myJsonObject back, with real Redis I get something like this "[object Object]", but with redis-mock I get the "original" JSON/JavaScript object as is (as it was inserted in).

So, the problem is: why redis-mock stores myJsonObject as is instead of storing myJsonObject.toString() ?

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