Cloudant返回错误消息:
{"error":"invalid_key","reason":"此请求的密钥使用索引无效."}
每当我尝试使用组合运算符"$或"查询索引时.
我的文档的样本是:
{
"_id": "28f240f1bcc2fbd9e1e5174af6905349",
"_rev": "1-fb9a9150acbecd105f1616aff88c26a8",
"type": "Feature",
"properties": {
"PageName": "A8",
"PageNumber": 1,
"Lat": 43.051523,
"Long": -71.498852
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-71.49978935969642,
43.0508382914137
],
[
-71.49978564033566,
43.052210148524
],
[
-71.49791499857444,
43.05220740550381
],
[
-71.49791875962663,
43.05083554852429
],
[
-71.49978935969642,
43.0508382914137
]
]
]
}
}
Run Code Online (Sandbox Code Playgroud)
我创建的索引是对于字段"properties.PageName",当我只查询一个文档时它工作正常,但是当我尝试多个文档时,我会收到开头引用的错误响应.
如果它有帮助,这里是电话:POST https://xyz.cloudant.com/db/_find
请求机构:
{
"selector": {
"$or": [
{ "properties.PageName": "A8" },
{ "properties.PageName": "M30" },
{ "properties.PageName": "AH30" }
]
},
"use-index": "pagename-index"
}
Run Code Online (Sandbox Code Playgroud)