我得到的RqlRuntimeError: Expected type TABLE_SLICE but found SELECTION:链接时,错误getAll和between方法。
r.db('mydb').table('logs') .getAll('1', {index: 'userId'}) .between(r.time(2015, 5, 1, 'Z'), r.时间(2015, 5, 4, 'Z'), {index: 'createdAt'})
index(es)在查询属于日期之间的数据userId=1以及createdAt日期之间的位置时,有没有办法使用?据我了解filter,不使用索引。
你不能像这样使用两个索引,但你可以创建一个复合索引:
r.table('logs').indexCreate('compound', function(row) {
return [row('userId'), row('createdAt')];
})
r.table('logs').between([1, firstTime], [1, secondTime], {index: 'compound'})
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
862 次 |
| 最近记录: |