I'm newbie to Couchbase and trying to understand whether it fits my domain. I have following data:
Birth City Name
1980 A John
1981 B Rick
1982 A Ase
1983 C Max
1984 C Bob
1980 A Rick
1983 D John
1982 A Bob
1985 C Bob
And not getting on how to implement similar to following SQL query:
SELECT birth FROM tbl WHERE city in (A,C) and name (Bob, Rick)
to get following data:
1984 C Bob
1980 A Rick
1982 A Bob
1985 C Bob
One big difference to 'startkey' and 'endkey' view usages is that it's not range selection, it's two different dimension values.
In my real scenario I need to put 1-5000 ID's into 'IN' statement. The only one way I found is to use indexing and N1ql http://docs.couchbase.com/prebuilt/n1ql/n1ql-dp3/#create-index.html but it seems not the fastest way to access data.
- What's the best practice to access multi-dimensional key data with lots of keys values?
- Is it okay to create big 'in' statements in N1ql?