【发布时间】:2015-02-18 12:25:16
【问题描述】:
我想列出两个时间戳之间 id=1 的记录,最后根据时间戳对它们进行排序。
Mysql查询一些东西:
Select * from test
where (timestamp between 100099323 AND 1423699323) AND id=1
order by timestamp
rethink 数据库中有超过 500 万份文档。
我尝试使用索引进行简单的 mysql 查询:
Select * from test where id=1 order by timestamp
而 Rethinkdb 查询是:
r.table('test').getAll(1, {index: 'id'}).orderBy({index: 'timestamp'})
但我收到错误:
RqlRuntimeError: Indexed order_by can only be performed on a TABLE or
TABLE_SLICE in:
r.table("test").getAll(1, {index: "id"}).orderBy({index: "timestamp"})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
有什么建议吗?
【问题讨论】:
标签: rethinkdb