Querying nearest geopoints in parse.com

I am using the following functions to query from geopoints in parse.com, my class is called “allJobs” and the field having geopoints in parse is called “coord”. I am suspicious I havent used “coord” in the codes below.

Do I need to replace that “centerPoint” below with “coord”.

this is my query in Corona

    headers = {}         headers["X-Parse-Application-Id"] = "11223"         headers["X-Parse-REST-API-Key"] = "111111"         headers["Content-Type"] = "application/json"         local params = {}                   local params = {}         params.headers = headers            local message1 = {}             message1["geoPoint"] = {             ["\_\_type"]= "GeoPoint",             ["latitude"]= -42.785311,             ["longitude"]= 147.527295         }     params.body = json.encode ( message1 )     network.request( "https://api.parse.com/1/functions/InfectionCheck\_BETA","POST",getFeatured,params)  

and this is my parse cloud function

Parse.Cloud.define("InfectionCheck\_BETA", function(request, response) { &nbsp; &nbsp; var geoPoint = request.params.geoPoint; &nbsp; &nbsp; var query = new Parse.Query("allJobs"); &nbsp; &nbsp; query.near("centerPoint", geoPoint); &nbsp; &nbsp; query.limit(10); &nbsp; &nbsp; query.find({ &nbsp; &nbsp; &nbsp; &nbsp; success: function(results) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var distances = []; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for (var i = 0; i \< results.length; ++i){ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; distances.push(results[i].kilometersTo(geoPoint)); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; response.success(distances); &nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; error: function(error) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; response.error("Error"); &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; }); });

I had to fix these two lines so it works. Not sure what that kilometersto is used correctly but it was one reason for the error. query.near(“coord”, geoPoint); distances.push(results[i]);

I had to fix these two lines so it works. Not sure what that kilometersto is used correctly but it was one reason for the error. query.near(“coord”, geoPoint); distances.push(results[i]);