javascript - 在表“test.users”上找不到索引“硬币”
问题描述
我正在使用 RethinkDB,并且正在制作“排行榜”功能。每次运行命令时,我都会不断收到该错误。
`Index `coin` was not found on table `test.users` in:
r.table("users").orderBy({
index: r.desc("coin")
}).limit(10)
在你说我是否插入了“硬币”之前,是的,我确实插入了它
解决方案
在“硬币”字段上添加索引
r.table("users").indexCreate("coin")
或者使用没有索引的 orderby:
r.table("users").orderBy(r.desc("coin"))...
推荐阅读
- rest - 在 CustomException 的情况下返回错误 JSON 响应,而不是在 Sping boot Restful ws 中映射到 bean 的常规 json 响应
- angularjs - 从下拉列表中删除第一个空白项并替换为默认选择选项文本
- concurrency - 任务定义中的非法声明
- python - Jupyter 内核网关上的 POST 请求验证
- c - 对,我有这段代码,系统命令不断出现错误
- postgresql - postgresql中的范围序列
- python - 如何将我的 python 代码连接到 Qt Creator
- python - 通过 message_id 使用 exchangelib 获取电子邮件
- javascript - ngrx-通过扩展运算符覆盖默认值?
- mysql - GROUP BY 子句在 phpmyadmin 中不起作用