使用 $or 选择器,没有可用于此选择器的索引
Using $or selector, There is no index available for this selector
我要取回
文档 _id
共 1
或
- 包含
value === 13
和 anotherValue === 56
的文档
错误:
There is no index available for this selector.
这是我的查询:
{
"selector": {
"$or": [
{
"_id": "1"
},
{
"value": "13",
"anotherValue": "56"
}
]
}
}
索引设置:
Your available Indexes:
special: _id
json: value, anotherValue
json: _id, value, anotherValue
对于此查询,您需要添加一个选择器来获取所有 ID,如下所示:
{
"selector": {
"_id": {"$gt":null},
"$or": [
{
"_id": "1"
},
{
"value": "13",
"anotherValue": "56"
}
]
}
}
您可以在此处了解更多信息:
https://cloudant.com/blog/mango-json-vs-text-indexes/
这样 post:
或者,您可以在所有字段上添加文本索引:
{
"index": {},
"type": "text"
}
然后您的原始选择器应该可以工作。
我要取回
文档
_id
共1
或
- 包含
value === 13
和anotherValue === 56
的文档
错误:
There is no index available for this selector.
这是我的查询:
{
"selector": {
"$or": [
{
"_id": "1"
},
{
"value": "13",
"anotherValue": "56"
}
]
}
}
索引设置:
Your available Indexes:
special: _id
json: value, anotherValue
json: _id, value, anotherValue
对于此查询,您需要添加一个选择器来获取所有 ID,如下所示:
{
"selector": {
"_id": {"$gt":null},
"$or": [
{
"_id": "1"
},
{
"value": "13",
"anotherValue": "56"
}
]
}
}
您可以在此处了解更多信息:
https://cloudant.com/blog/mango-json-vs-text-indexes/
这样 post:
或者,您可以在所有字段上添加文本索引:
{
"index": {},
"type": "text"
}
然后您的原始选择器应该可以工作。