|
|
|
|
|
by stewsnooze
5822 days ago
|
|
Check out this code for searching locally with mongo. It doesn't get simpler. Straight from geosay.com class GeosayController < ApplicationController def api
expires_in 1.minutes, :public => true
results = Tweet.near(params[:lat].to_f,params[:lon].to_f)
render :json => results
end
end.... class Tweet include MongoMapper::Document
def self.near(lat, lon)
self.all( :latlong => {'$near' => [lat, lon]}, :limit => 30)
end
end |
|
Before then we were looking at Postgres for its geo stuff and things like cassandra also.