You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/06/15 03:25:54 UTC
[GitHub] worldspawn opened a new issue #1388: Couchdb documentation for json
index definition is unclear on support for indexing array fields
worldspawn opened a new issue #1388: Couchdb documentation for json index definition is unclear on support for indexing array fields
URL: https://github.com/apache/couchdb/issues/1388
The documentation here http://docs.couchdb.org/en/2.1.1/api/database/find.html#db-index says
```Index object format for JSON type indexes
The index object is a JSON array of field names following the sort syntax. Nested fields are also allowed, e.g. “person.name”.```
It doesn't explicitly state that indexing array fields is allowed. It doesnt' provide an example of how to do it if it is.
To clarify, given:
```{
"_id": "theid",
"results": [
{ "type": "sometype" }
]
}```
I know i can query that with the $elemMatch selector but can it be indexed too? I've read a few examples suggesting that a notation like "results[].type" or "results.[].type" can be used but in my own tests I always get a warning stating that no matching index could be found.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services