【问题标题】:Parse Query where near geopoint error解析查询靠近地理点错误的位置
【发布时间】:2017-05-08 04:42:31
【问题描述】:

所以我已经发布了我的问题here。简而言之,我无法在解析服务器上查询 Geopoint 我收到一个奇怪的错误:

{"code":1,"message":"Internal server error."} (Code: 1, Version: 1.14.4) Optional("{"code":1,"message":"Internal server error."}")

在仪表板日志中,它显示了一些更复杂的内容:

2017-05-08T04:06:47.283Z - Uncaught internal server error. { MongoError: error processing query: ns=heroku_r6dg7cvc.CommentaryTree: $and _created_at $gt new Date(1494130007253) _rperm $in [ null "*" "a81FrGp2R3" ] GEONEAR field=location maxdist=7.17619e-07 isNearSphere=1 Sort: {} Proj: {} planner returned error: unable to find index for $geoNear query at Function.MongoError.create (/app/node_modules/mongodb-core/lib/error.js:31:11) at /app/node_modules/mongodb-core/lib/connection/pool.js:489:72 at authenticateStragglers (/app/node_modules/mongodb-core/lib/connection/pool.js:435:16) at Connection.messageHandler (/app/node_modules/mongodb-core/lib/connection/pool.js:469:5) at Socket.<anonymous> (/app/node_modules/mongodb-core/lib/connection/connection.js:321:22) at emitOne (events.js:96:13) at Socket.emit (events.js:191:7) at readableAddChunk (_stream_readable.js:178:18) at Socket.Readable.push (_stream_readable.js:136:10) at TCP.onread (net.js:561:20) name: 'MongoError', message: 'error processing query: ns=heroku_r6dg7cvc.CommentaryTree: $and\n _created_at $gt new Date(1494130007253)\n _rperm $in [ null "*" "a81FrGp2R3" ]\n GEONEAR field=location maxdist=7.17619e-07 isNearSphere=1\nSort: {}\nProj: {}\n planner returned error: unable to find index for $geoNear query', waitedMS: 0, ok: 0, errmsg: 'error processing query: ns=heroku_r6dg7cvc.CommentaryTree: $and\n _created_at $gt new Date(1494130007253)\n _rperm $in [ null "*" "a81FrGp2R3" ]\n GEONEAR field=location maxdist=7.17619e-07 isNearSphere=1\nSort: {}\nProj: {}\n planner returned error: unable to find index for $geoNear query', code: 2 } MongoError: error processing query: ns=heroku_r6dg7cvc.CommentaryTree: $and _created_at $gt new Date(1494130007253) _rperm $in [ null "*" "a81FrGp2R3" ] GEONEAR field=location maxdist=7.17619e-07 isNearSphere=1 Sort: {} Proj: {} planner returned error: unable to find index for $geoNear query at Function.MongoError.create (/app/node_modules/mongodb-core/lib/error.js:31:11) at /app/node_modules/mongodb-core/lib/connection/pool.js:489:72 at authenticateStragglers (/app/node_modules/mongodb-core/lib/connection/pool.js:435:16) at Connection.messageHandler (/app/node_modules/mongodb-core/lib/connection/pool.js:469:5) at Socket.<anonymous> (/app/node_modules/mongodb-core/lib/connection/connection.js:321:22) at emitOne (events.js:96:13) at Socket.emit (events.js:191:7) at readableAddChunk (_stream_readable.js:178:18) at Socket.Readable.push (_stream_readable.js:136:10) at TCP.onread (net.js:561:20)

搜索了一段时间,可能与this有关。 解决方案与第二个链接相同,但我不知道如何将解决方案应用于 heroku 上的解析服务器。

【问题讨论】:

  • 你能贴一些代码吗?

标签: mongodb parse-server geopoints


【解决方案1】:

您在 Heroku 上使用 mlab 扩展程序?转到 MLab 并为您的集合中的地理字段添加索引。您无需为此使用 API,请使用 MLab 仪表板。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2016-05-02
  • 1970-01-01
  • 2011-06-09
  • 2018-06-11
  • 2021-11-29
  • 1970-01-01
  • 1970-01-01
  • 2014-06-26
相关资源
最近更新 更多