I have two keys(geo zset) in redis first "DRIVERS" second "ORDERS" and members inside them. Is it possible to calculate distance between member in DRIVERS and member inside ORDERS? Manual https://redis.io/commands/geodist says that it is only possible between members in one key.
There's no built-in way to do that. However, You can try the following two solutions.
GEOPOS
command to get locations (longitude and latitude) of the driver and order. Then you can calculate the distance between them by yourself. Or you can put the results into a new GEOSET
and let Redis do the calculation.GEOSET
, e.g. GEOADD geo long1 lat1 driver:id
, GEOADD geo long2 lat2 Order:id