【发布时间】:2017-04-17 14:14:44
【问题描述】:
我正在 nodejs 后端进行地理位置搜索。而mongodb是数据库。为了做到这一点,我从前端获取值。我正在使用 map getbound 来获取视口数据。下面是一些包含纬度和经度的变量。
var topLeftLong = parseFloat(req.body.topLeftLong);
var topLeftLat = parseFloat(req.body.topLeftLat);
var topRightLong = parseFloat(req.body.topRightLong);
var topRightLat = parseFloat(req.body.topRightLat);
var bottomRightLong = parseFloat(req.body.bottomRightLong);
var bottomRightLat = parseFloat(req.body.bottomRightLat);
var bottomLeftLong = parseFloat(req.body.bottomLeftLong);
var bottomLeftLat = parseFloat(req.body.bottomLeftLat);
虽然我正在获取这些数据,但我想将纬度和经度放在一个数组中。但是每当我尝试将数据推送到数组中时,都会出现以下错误。
【问题讨论】:
标签: arrays node.js mongodb express coordinates