Couchbase N1QL: index and query on array fields -
platform: couchbase server 4.0 beta, java client 2.1.3
i looking similar sql join. example have documents of form field2 embedded in document instead of in separate table have in relational db:
{field1:" ..", field2:[{key:1, ...},{key:3, ...},..],...}.
how can achieve this:
select * bucket field2.key=3;
and how can index key, hypothetical example:
create index idx_key on bucket(field2.key);
what if did this:
select * `your-bucket-here` fields field in fields.field2 satisfies field.key = 3 end
this way long 1 nested array item contains value, returned.
in terms of creating index, looking create secondary index or primary index? this:
create primary index index_name on `your-bucket-name-here` using gsi; create index index_name on `your-bucket-name-here` using gsi;
let me know how goes!
best,
Comments
Post a Comment