I'm learning Couchbase, now on version 3.x
My doubt is, when should i use a N1QL query vs a View query?
And, are there performance differences between them?
Note: I have a situation:
A Bucket with two document types for my Traveling App: Route and City
A Route doc holds the information about the traveling route and an array of City ids that are part of it, then another doc holds the city's information (each city having its own doc). Example:
//Bucket : "Traveling App"
{
"type" : "route"
"name" : "The Great Adventure",
"cities" : ["234", "h4345", "h42da"]
}
{
"type" : "city",
"name" : "Little Town",
"UID" : "234"
}
When i query for a certain traveling route, should i do a N1QL query or a View query?
Because i would have to first open the Route doc, get the cities array than get each City doc.
And i think this architecture would be best, because some routes can have very few cities and others can have a lot of cities.