【问题标题】:google cloud datastore, javascript, cannot use query.order谷歌云数据存储,javascript,无法使用 query.order
【发布时间】:2019-07-26 10:11:38
【问题描述】:

Google Cloud 数据存储区,没有为简单的单字段排序找到匹配的索引。我在本地运行,通常可以很好地处理数据库。

根据Query documentation, 看起来很简单。我什至尝试在 GC 数据存储控制台中创建手动索引。

我正在尝试按单个整数字段排序。

const query = dataStore.createQuery('myRecords')
query.order('anyField')
dataStore.runQuery(query)

我希望按顺序获得结果列表,但出现此错误(如下)。 没有 query.order(),我得到的结果还可以,但是很乱。

{ Error: no matching index found.
    at Http2CallStream.call.on (C:\Users\...\node_modules\@grpc\grpc-js\build\src\client.js:101:45)
    at Http2CallStream.emit (events.js:203:15)
    at process.nextTick (C:\Users\...\node_modules\@grpc\grpc-js\build\src\call-stream.js:71:22)
    at process._tickCallback (internal/process/next_tick.js:61:11)
  code: 9,
  details: 'no matching index found.',
  metadata: Metadata { options: undefined, internalRepr: Map {} },
  note:
   'Exception occurred in retry method that was not classified as transient' }

编辑:我承认 google 数据存储对我来说太复杂了,并且使用 cloud mongo 从头开始​​工作的时间比我尝试解决不应该这么困难的事情所花费的时间要短。

感谢评论的人。

【问题讨论】:

  • 看看这条评论 stackoverflow.com/a/29807764/11833391 和线程上的其他人,希望对您有所帮助。
  • 您使用的是 Native 模式还是 Datastore 模式?您能否分享完整的设置以便正确复制?

标签: javascript google-cloud-datastore


【解决方案1】:

回答:我和 mongo 一起去了。堆更干净。

【讨论】:

    猜你喜欢
    • 2020-01-25
    • 2015-07-17
    • 1970-01-01
    • 1970-01-01
    • 2017-05-11
    • 1970-01-01
    • 2014-01-11
    • 2018-10-11
    • 2013-05-17
    相关资源
    最近更新 更多