n1ql query views

Hi,

I'm just getting started with Couchbase and I discovered N1QL which makes things easy ..

Is it possible to query "views" using N1QL ?

Thanks,

1 Answer

« Back to question.

Hello,

The answer is yes.

CREATE INDEX index-name ON bucket-name(field-name)

will create a view in the background.

EXPLAIN SELECT ... WHERE field-name ...

will show the query plan, which will indicate if your SELECT statement would use the view.