Startkey and endkey feature in view for PREPARE/EXECUTE statement

I can use startkey and endkey in view to ignore some key to query data, such as


to ignore the key3,key4
It is useful feature,If I can use the similar feature,it will be nice.
Now, I can only create several PREPARE statement to hold the different key combination.
Is there a good way to improve it?

This is not really a question of PREPARE. You can use BETWEEN, <, >, <=, <=, AND, OR, and other features of N1QL to specify the ranges of data you want.

You should also use EXPLAIN to understand how your query would be executed (make sure it is using an index).