Filter on array filed in couchbase and couchbase lite

Create a view whose map function calls emit once for each item of states, with the item as the key. (The value can be nil, or the name if you want to display that.) Then query that view with key = "CA".