How "use keys" is used for indexed documents

#1

Hi,

I am very new to couchbase server and using couchbase 4.5 . I wanted to understand how “use keys” is used. does it do primary lookup of index or secondary lookup?

#2

That’s more a question for the n1ql section, but I’ll answer it anyway: USE KEYS 'foo' does a primary lookup (that would be very similar to a bucket.get("foo") using the SDK).

#3

Note that “primary lookup” here does not mean primary index. No index is used at all with USE KEYS.

#4

ah right, thanks for making that clearer @geraldss

1 Like