How to filter data on composite key so that i get the intersection not the union?

whenever i filter the data on my composite key. Instead of getting the union i want intersection of result.

For example:-

for query(a , b) i’m getting some values. Actually i do not have any values that matches for query(a , b) but it is showing the values for query(a) on query(a,b).

I do not want the union but the intersection just as we do in sql using where clause.

In general you can control the “where” clause in views in two places:

  • In your map function, where you decide which parts go into the index in the first place.
  • At runtime, when you define your ranges (startkey/endkey) and grouping to filter in the result set.

Do you have a specific example which we can look at? You could also try it with N1QL, but this is not GA yet.