Your location:Home>文件对比 数据库管理 >数据库管理工具

Couchbase N1QL Query Language

                                              

What is N1QL?

N1QL is a declarative query language that extends SQL for JSON. You can query data via native framework and language integration, a fluent API, or the JDBC/ODBC drivers.

N1QL enables you to query JSON documents without any limitations - sort, filter, transform, group, and combine data with a single query. That’s right. You can combine data from multiple documents with a JOIN. That flexible data model you were promised? This is it. You’re no longer limited to “single table” and “table per query” data models.

                                                           

You can improve query performance with secondary indexes. Want to create a bunch of indexes? Go for it. Want to create a compound index on multiple fields? Go for it. Worried about what will happen to query performance as the number of nodes increases? Don't. We implemented global secondary indexes. The key word being "global". A global secondary index is not partitioned. It's a whole index. After all, it's a lot faster to check a whole index on one node than it is to check a partial index on every node.

Is it SQL?

The product catalog may be stored in JSON, but it’s queried in SQL – well, N1QL.

The data model is comprised of authors, books, reviews, and awards. An author has an ID, first name, last name, country, and more. A book has an ID, name, date published, author name (for convenience), author ID, and more. A review has a book name (for convenience), book ID, rating, and more. An award has a name, year, book ID, author ID, and more.

                                             

北京哲想软件有限公司