你好,我在 _Installation的class里加上一个geopoint的field叫作 lastKnownLocation,以便之后推送给某个地点附近的装置。但在云引擎中使用

var query = new AV.Query('_Installation');
query.withinKilometers('lastKnownLocation', [SOME LOCATION], [SOME DISTANCE]);

则会返回以下错误:

{ code: 303,
message: 'Fail to execute operation on storage. Command failed with error 2: \'failed on : SHARD01\' on server localhost:27020. The full response is { "shards" : { }, "cause" : { "errmsg" : "exception: error processing query: ns=DUQ8BnlaIscimKTp3dg1LBTF-MdYXbMMI._Installation limit=0 skip=0\\nTree: $and\\n    $not\\n        nearbyMessagePush == false\\n    GEONEAR  field=lastKnownLocation maxdist=0.000313922 isNearSphere=1\\nSort: {}\\nProj: {}\\n planner returned error: unable to find index for $geoNear query", "code" : 2, "ok" : 0.0, "$gleStats" : { "lastOpTime" : { "$timestamp" : { "t" : 1461587307, "i" : 8 } }, "electionId" : { "$oid" : "5714a03102ba06ebc00dacdf" } } }, "code" : 2, "ok" : 0.0, "errmsg" : "failed on : SHARD01" }' }

请问Installation是否支持使用GeoPoint作为query的条件?貌似是缺少了 indexing?

你好,可以在控制台将这个列删掉,然后重新建立一个类型为 GeoPoint 的列尝试下。

该应用已经在production了,这样做的话会流失用户数据,请问有其他的方法吗?