RethinkDB supports geolocation operations and you can write rich geographical data by combining geospatial queries and changefeed. Here we are going to look over some ReQL functions that we can use to perform geolocation operations.
You can store a coordinate using point()
ReQL API. It accepts longitude
and latitude
as input parameters. Here is a sample example of adding the location of Mumbai
and Delhi
in our table. I am using a web administrative console to execute the query as follows:
r.table("geo").insert([ { place : 'Mumbai', location :r.point(19.0760,72.8777) }, { place : 'Delhi', location :r.point(28.6139,77.2090) }])