N1QL and existing views

Gentlefolk,

Currently, N1QL looks like a language exploiting CB views under the hood.

Is it possible to use existing views with N1QL?

As you know, indices are expensive to create and maintain. I would like to try N1QL on my existing databases (230M+ documents, 360+ GB) and exploit their views.

Is there a way to do this?

Conversely, if I use N1QL indices in lieu of views, can I query them using existing Client SDKs? (In my case, I would use the Python SDK.)

Anon,
Andrew

Andrew,

To your second question, the answer is yes. N1QL-created views can be accessed via the client SDK and the REST API.

To your second question, it depends on the existing views. If the view has a map function that emits a field and a document id, and the view has no reduce, then it may be usable. The view’s name would also need to match the convention that N1QL uses internally to identify indexes.

Thanks.