arjunmehta / node-georedis

Super fast geo queries.
MIT License
192 stars 33 forks source link

node_redis: Deprecated: The ZADD command contains a "undefined" argument. #14

Closed prashantidealittechno closed 8 years ago

prashantidealittechno commented 8 years ago

node_redis: Deprecated: The ZADD command contains a "undefined" argument. This is converted to a "undefined" string now and will return an error from v.3.0 on. Please handle this in your code to make sure everything works as you intended it to.

   var geo = georedis.initialize(client, {
        zset: 'acceptToStart',
        nativeGeo: false
    });

If you can check and fix. why I am getting this error. How can I fix this.

arjunmehta commented 8 years ago

@prashantidealittechno thank you for bringing this to my attention. I'll have a look and patch a fix soon.

keligijus commented 8 years ago

Hi, I'm probably facing a very related issue. Here's the error I get:

/project/node_modules/georedis/lib/interfaceEmulated.js:38
    this.client.zadd(argArray, callBack);
                ^

TypeError: this.client.zadd is not a function
    at EmulatedInterface.geoadd_multi (/project/node_modules/georedis/lib/interfaceEmulated.js:38:17)
    at Set.addLocations (/project/node_modules/georedis/main.js:57:26)
    at writeToRedis (/project/api/utilities/importGeolocations.js:76:9)
    at /project/api/utilities/importGeolocations.js:25:9
    at tryToString (fs.js:414:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:401:12)
arjunmehta commented 8 years ago

@prashantidealittechno @keligijus I'll have time this weekend to look at this.

Can you tell me what version of Redis you are using? If you're using node-redis, which version of node-redis you're using? Otherwise, what client are you using to with georedis?

Please give me as much information as you can about the circumstances. My tests pass when using the latest version of node-redis so I can not replicate.

prashantidealittechno commented 8 years ago

Hello @arjunmehta, sorrry for the late response, My Redis version is 3.0.6. from he time same I post the issue. My node js dependencies are below:

"dependencies": {
    "body-parser": "^1.15.2",
    "express": "^4.14.0",
    "georedis": "^3.0.3",
    "redis": "^2.6.2"
  },
arjunmehta commented 8 years ago

@prashantidealittechno This is really strange. Are you following the instructions on how to use this module correctly? ie:

You need to first create your redis client:

var redis = require('redis'),
    client = redis.createClient()

And THEN initialize georedis:

var geo = georedis.initialize(client, {
    zset: 'acceptToStart',
    nativeGeo: false
});
arjunmehta commented 8 years ago

I think I'll close this unless it gets reported again by others.