find() method in mongodb returns undefined
问题 I am trying to create a route to retrieve the records with nearby location coordinates. I checked the logs and found the "docs" value as undefined. What am I going wrong with? router.get('/userlist/:lat/:lng', function (req, res) { var db = req.db; var lat = req.params.lat, lng = req.params.lng; console.log("lat "+lat); console.log("lng "+lng); var collection = db.get('userlist'); collection.find({ "location": { $nearSphere: { $geometry: { type: "Point" , coordinates: [ lat , lng ] } } } }, {