Querying with N1QL

  • Deepak Vohra


Though Couchbase Server is a NoSQL database it supports an SQL-like query language called N1QL. N1QL supports most of SQL features with additional features suitable for a document-oriented database. N1Ql’s use cases include complex queries embedded in applications, and analytics & reporting using ad-hoc queries. Unlike the fixed format of a table in a relational database, the documents stored in Couchbase Server are based on a flexible schema JSON model with nested objects and arrays. The schema-based document model of Couchbase Server requires a flexible path-based language rather than the fixed row/column structure of SQL. N1QL supports different kind of expressions for different kind of operations such as filtering, grouping, and ordering, to mention a few. N1QL queries Couchbase documents, not rows or columns. In this chapter we shall introduce N1QL with some examples:


Array Element NoSQL Database Journal Field Select Query String Pattern 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Copyright information

© Deepak Vohra 2015

Authors and Affiliations

  • Deepak Vohra
    • 1
  1. 1.BCCanada

Personalised recommendations