Book Image

Couchbase Essentials

Book Image

Couchbase Essentials

Overview of this book

Table of Contents (15 chapters)
Couchbase Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 5. Introducing N1QL

After two chapters of exploring views and MapReduce, you might be wondering just how you would go about finding data in your bucket more easily. If you've worked with relational systems, you're likely used to being able to query your database ad hoc without having to create a stored procedure first. Having to write a view for one-off queries of your data probably seems less than optimal.

Fortunately, there is another option with Couchbase and it is known as N1QL (pronounced nickel). N1QL is a query language, reminiscent of SQL. Not only does it support ad hoc querying of your data, it also provides a means to perform joins and aggregation.

At the time of writing this book, N1QL is still in developer preview, though some Couchbase SDKs are starting to see support for it. We'll explore N1QL in some detail throughout this chapter, but keep in mind that with any prerelease product some changes are likely. However, the core concepts and interface are unlikely to see...