N1QL is SQL for JSON. The goal of N1QL is to give developers and enterprises an expressive, powerful, and complete language for querying, transforming, and manipulating JSON data.
The goal of N1QL is to give developers and enterprises an expressive, powerful, and complete language for querying, transforming, and manipulating JSON data. Hence, N1QL supports full set of SELECT, INSERT, UPDATE, DELETE, MERGE statements along with a rich set of expressions and operators.
N1QL is inspired from SQL. If you know SQL, you’ll learn N1QL quickly. But, having SQL on the flexible structure of JSON require a bit of learning. To make your learning even faster, we have an interactive tutorial.
http://query-tutorial.couchbase.com/tutorial/
The major sections are:
- Section 1. N1QL basics
- Section 2. Joins
- Case Study I. E-Commerce
- Case Study II. Social Game
You can modify the queries and see how the result changes. Do the EXPLAIN to see the Query plan. Have fun learning N1QL.
Here’s a sample screen.
Awesome job, team – love it! Of course, I tried running a DELETE statement right away. It was great to see that the access from this tutorial is read-only! :-D
Yes. Once you learn SELECT, you pretty know the language well.
You can EXPLAIN your DELETE statements to see how the query executes. If you’re into query plans, checkout the visual explains with profiling in Couchbase 5.0.