Welcome to the N1QL (pronounced "Nickel") corner! We're excited to introduce N1QL - our next generation query language. N1QL presents easy and familiar abstractions to quickly develop scalable applications that work with next generation database systems. It allows for joins, filter expressions, aggregate expressions, subqueries, data manipulation language (DML), and many other features to build a rich application. Go ahead and give N1QL a spin today by trying out the online tutorial or downloading N1QL for Couchbase Server.
N1QL has an interactive online tutorial and a N1QL cheat sheet. The online tutorial is a good way to get started and play with N1QL in an easy, fun environment. The cheat sheet is a quick glance and easy reference of the N1QL syntax. For more information, see:
To get started, navigate to the downloads page and download N1QL.
To run N1QL on your local system:
- Expand the package archive.
- Open a command window and navigate to your local N1QL directory.
- Start N1QL by entering one of the following commands:
# Unix command $ ./start_tutorial.sh # Windows command $ ./start_tutorial.bat
- To run the tutorial, open a browser and go to http://localhost:8093/tutorial.
- To connect N1QL with your Couchbase Server, enter the following command:
$ ./cbq-engine -datastore=http://[server_name]:8091/
- To use the command-line interactive query tool, enter the following command:
$ ./cbq -engine=http://[couchbase-query-engine-server-name]:8093/
- Before issuing queries against a Couchbase bucket, run the following command from
the query command line:
$ CREATE PRIMARY INDEX ON [keyspace-name]
The N1QL documentation provides detailed information including syntax, semantics, and example code. For more information, see:
Blogs and forums
Couchbase blogs and forums have a dedicated area for N1QL topics. The forum allows you to interact directly with the N1QL engineering team. For more information, see:
The following webinar provides a video for N1QL ad hoc querying including the basics of the query language, use cases, and a hands-on demo that shows how N1QL can be used in sample e-commerce and social gaming applications.