Skip to content

Instantly share code, notes, and snippets.

@gmanley
Created April 2, 2014 19:53
Show Gist options
  • Save gmanley/9941835 to your computer and use it in GitHub Desktop.
Save gmanley/9941835 to your computer and use it in GitHub Desktop.
properties = Mongo::MongoClient.new['flipt_v1_0']['properties']
properties.find.each do |property|
properties.update(
{ "_id" => property['_id'] },
{ "$set" => {
"geolocation" => {
"type" => "Point",
"coordinates" => [
property["location"]['longitude'].to_f,
property["location"]['latitude'].to_f
]
}
}}
)
end
properties.ensure_index("geolocation" => "2dsphere")
@Favorwilliams
Copy link

My Pleasure to write you,
My name is Favor Williams,
My email address is
( [email protected])
Am interested to know
more about you,
Contact me for my
photo and other
important issue via,

[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment