【发布时间】:2016-03-10 12:10:06
【问题描述】:
我有以下数据库结构:
{"_id": "0096874","genre": ["Adventure","Comedy", "Sci-Fi" ]}
{"_id": "0099088","genre": ["Comedy", "Sci-Fi", "Western"]}
并且喜欢像在 mongodb 中那样查询它
db.movies.find({genre: {$in: ["Comedy"]}})
当我为整个数据库使用文本索引时它可以工作,但这似乎非常浪费:
// index
{
"index": {},
"type": "text"
}
//query
{
"selector": {
"genre": {
"$in": ["Comedy"]
}
},
"fields": [
"_id",
"genre"
]
}
以下索引不起作用:
{
"index": {
"fields": [
"genre"
]
},
"type": "json"
}
什么是 cloudant 查询的正确索引,它不索引整个数据库? 感谢您的帮助
【问题讨论】:
标签: couchdb cloudant couchdb-mango