I’m having a hard time finding solid information on writing views with CB lite. I know there’s documentation for native, but there’s very little for Cordova. Instead, I’ve been using the documentation from CB Server, even though I know that CB lite only has subset of the Server view features.
I need to write a view where I’m joining two documents, like a blog post document and comment documents, so the output is a list of post documents with an array of comments embedded.
You can’t directly do joins the way you would in a relational database, but you can use a combination of compound keys and reducing to do some of the same work. I gave an example of this in a Couchbase Connect presentation from 2014.