I've been trying to create a filtered index as per CouchDB 2.1 documentation, but failed miserably (at the bottom of the section there's an example for "index creation using all available query parameters").
Basically, I have a bunch of documents that have different class
attribute on them (just like a document type). I am trying to create an index only for documents with class="File"
and extension="pdf"
{
"index": {
"fields": [
"_id", "class", "extension"
],
"selector": {
"class": {
"$eq": "File"
},
"extension": {
"$eq": "pdf"
}
}
},
"type": "json"
}
However, when I attempt to create an index from Futon, i get the Invalid key selector for this request error. Am I interpreting documentation wrong or was it something I missed?