如何在Redis GEOADD中将Lat长添加到密钥中

时间:2019-01-11 14:49:35

标签: node.js redis

我正在像这样在Redis服务器中添加旅行的纬度和经度

redisClient.geoadd(tripId, [result.start_lat, result.start_long, "startLocation"], function (err, result) {
                        console.log(err, result);
                    });

我想针对startLocation键获取这些经度和纬度。我该如何实现?

1 个答案:

答案 0 :(得分:1)

您应该为此调用GEOPOS命令。

redisClient.geopos(tripId, "startLocation"], function (err, result) { console.log(err, result); });