有人能告诉我是否有一种方式来查询嵌套字段的索引支持。我创建了嵌套索引,如:r.table('comments').indexCreate('authorName', r.row("author")("name")).run(conn, callback),但我看不到查询所有注释的任何方式,这些注释具有指定的作者名称-文档显示,getAll命令接受数字、字符串、bool、伪类型或数组,而筛选器命令目前没有索引优化器。
发布于 2016-01-25 15:16:27
我刚刚尝试为包含以下行的表创建一个名为"authorName“的嵌套authorName辅助索引:
[
{
"author": {
"name": "Lennon"
},
"text": "c1",
"id": "4f66dcac-be74-49f2-b8dc-5fc352f4f928"
},
{
"author": {
"name": "Cobain"
},
"text": "c2",
"id": "82936ae0-bc4d-435b-b19a-6786339da232"
}
]看起来
r.table('comments').getAll("Cobain", {index: "authorName"}).run(conn, callback)正在工作并返回
{
"author": {
"name": "Cobain"
},
"text": "c2",
"id": "82936ae0-bc4d-435b-b19a-6786339da232"
}https://stackoverflow.com/questions/34990622
复制相似问题