Is it possible to query on only the 2nd value of an index?

#1

I’m guessing the answer to this is “no” but figured I’d give it a shot.

If I have a view whose indexes look like this…
index0: [“aaa”,“def”]
index1: [“bbb”,“111”]
index2: [“ccc”,“222”]
index3: [“ddd”,“111”]

Can I search for all items that that have the second array element of “111”? I thought I might be able to do something like:
startkey: ["!", “111”]
endkey: [“Z”, “111”]
… but that returns everything.

#2

Nope, the items in an array key are primary key, secondary key, etc. just like in a regular index. If you want to search using a different key you have to create another view/index where it’s the primary key.