Skip to content

Ruby example (redis rb)

Josh Baker edited this page Jan 2, 2017 · 3 revisions

redis-rb project page

Install

gem install redis

Example

Since tile38 is using the redis commands but not the redis semantics it is advised to use the generic call method to send commands to the tile38 server.

require 'redis'
    
redis = Redis.new(host: 'localhost', port: 9851)
    
redis.call(:set, 'fleet', 'truck1', 'POINT', '33', '-115')
# => 'OK'
    
redis.call(:get, 'fleet', 'truck1')
# => '{"type":"Point","coordinates":[-115,33]}'

Thanks to Jonatan Reiners for providing this example code

Clone this wiki locally