arjunmehta / node-geo-proximity

Super fast proximity searches of geo coordinates.
MIT License
132 stars 18 forks source link

Cannot read property 'ZRANGEBYSCORE' of undefined #11

Closed hems closed 9 years ago

hems commented 9 years ago

Any idea on what might be causing the error?

I'm running redis 2.8.19 on my localhost

"add" and "find" are just aliases for the functions your have in your readme file.

coffee> add 'xxx', 43.6667, -79.4167, ( error, reply ) -> console.log arguments
coffee> { '0': null, '1': 1 }

coffee> find 43.6667, -79.4167, 500, ( error, reply ) -> console.log arguments
/Volumes/backpack/git/oceanelevent/whatever/redis-geo/node_modules/geo-proximity/lib/query.js:91
        multi.ZRANGEBYSCORE(zset, range[0], range[1]);
             ^
TypeError: Cannot read property 'ZRANGEBYSCORE' of undefined
  at buildMultiWithoutValues (/Volumes/backpack/git/oceanelevent/whatever/redis-geo/node_modules/geo-proximity/lib/query.js:91:14)
  at queryByRanges (/Volumes/backpack/git/oceanelevent/whatever/redis-geo/node_modules/geo-proximity/lib/query.js:59:9)
  at Set.nearby (/Volumes/backpack/git/oceanelevent/whatever/redis-geo/node_modules/geo-proximity/main.js:97:5)
  at module.exports (/Volumes/backpack/git/oceanelevent/whatever/redis-geo/src/lib/people/find.coffee:6:13)
  at repl:1:5
  at Object.exports.runInThisContext (vm.js:70:17)
  at REPLServer.replDefaults.eval (/usr/local/Cellar/nvm/0.23.0/v0.11.13/lib/node_modules/coffee-script/lib/coffee-script/repl.js:46:42)
  at bound (domain.js:257:14)
  at REPLServer.runBound [as eval] (domain.js:270:12)
  at repl.js:277:12
  at REPLServer.<anonymous> (/usr/local/Cellar/nvm/0.23.0/v0.11.13/lib/node_modules/coffee-script/lib/coffee-script/repl.js:79:9)
  at REPLServer.EventEmitter.emit (events.js:129:20)
  at REPLServer.Interface._onLine (readline.js:202:10)
  at REPLServer.Interface._line (readline.js:531:8)
  at REPLServer.Interface._ttyWrite (readline.js:812:14)
  at ReadStream.onkeypress (readline.js:101:10)
  at ReadStream.EventEmitter.emit (events.js:129:20)
  at emitKey (readline.js:1149:12)
  at ReadStream.onData (readline.js:892:14)
  at ReadStream.EventEmitter.emit (events.js:107:17)
  at readableAddChunk (_stream_readable.js:159:16)
  at ReadStream.Readable.push (_stream_readable.js:126:10)
  at TTY.onread (net.js:514:20)
hems commented 9 years ago

was an issue with my connection, had to fix my "createClient" call.

arjunmehta commented 9 years ago

Hum, strange that the add method worked though!

hems commented 9 years ago

@arjunmehta totally strange!!

i got super confused! but then i realised the "ready" and "connect" wasn't being fired on my client, so updated my connection info and it worked out.

i think maybe the "add" was just "queued" to happen on the client which was still hopping to connect?