mongify icon indicating copy to clipboard operation
mongify copied to clipboard

Can't find geoencoding

Open Deepankar01 opened this issue 8 years ago • 7 comments

I tried searching for geo-location in mongify but it isn't there i have two different columns as LAT and LONG

table "tbb_buddy_group" do column "buddyGroupId", :integer column "userId", :integer column "LAT", :float column "LNG", :float column "groupId", :integer column "floating_LAT", :float column "floating_LNG", :float end how can i do geo-location using mongify ?

Deepankar01 avatar Jul 04 '16 15:07 Deepankar01

Wow, that's a great point, there isn't any geo-location setup, you might be able to do it via a before_save method.

anlek avatar Jul 04 '16 19:07 anlek

before_Save do |row| row.LAT = Array[row.LAT,row.LNG] end

is this the right way ? all i want is to merge LAT LNG in a single array

Deepankar01 avatar Jul 05 '16 05:07 Deepankar01

You might want to remove the original values from the record

before_save do |row|
  row.location = Array(row.delete(:LAT), row.delete(:LNG))
end

The value will be stored in your db under location

anlek avatar Jul 05 '16 17:07 anlek

thanks for the update yesterday i did thanks for the delete row.delete before_save do |row| row.loc = Array[row.LAT,row.LNG] end

Deepankar01 avatar Jul 06 '16 04:07 Deepankar01

Did it work out for you? If so, I can try adding it to the docs.

anlek avatar Jul 06 '16 16:07 anlek

Yes yes I worked perfectly and please do add it in the docs As it will be really helpful

Thanks 😊

Deepankar01 avatar Jul 08 '16 05:07 Deepankar01

hi everybody, i need this also, the information provided here was helpful. i will test this with my database and provide you with feedback.

IsamAljawarneh avatar Jul 30 '17 11:07 IsamAljawarneh