From the course: Introduction to Couchbase

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Using JOINs and Parameters with SQL++/N1QL

Using JOINs and Parameters with SQL++/N1QL - Couchbase Tutorial

From the course: Introduction to Couchbase

Using JOINs and Parameters with SQL++/N1QL

- [Instructor] Setting JOINs and parameters are two ways to enhance querying in Couchbase. JOINs are connections between information in different document sets. They can increase efficiency and make querying even more effective and faster. The best strategy when writing effective JOINs is to let the end result guide the journey. Before completing a JOIN, stop and ask: what information do I want users to see and access? For example, there may be many times when I'd like users to see more information than what is in one document alone. Let's look at an example of what I mean. These two documents have many points of data, but on the left, an airline code of airline_137 will probably not be familiar to my users. So I'll JOIN my right side document with the airline key 137, and this will give users the airline name, as well as other details they might need. Because Couchbase is a key-value store and this is a key-value operation, there is no index needed for this JOIN. Now let's see what…

Contents