I have a 'product' document, which has an attribute 'categoryId' to reference the 'category' document. When I fetch a product, I would like to be able to get the name of the category, not only the id. I know that I should create a view for this, but I'm new to couchbase, and I've looked around in google but I couldn't find how exactly to do it.
this would be the product document
{
"id": 1,
"name": "Guitar",
"categoryId": 5,
"jsonType": "product",
... (other fields)
}
And this would be the category document
{
"id": 5,
"name": "Musical Instruments",
"description": "",
"jsonType": "category"
}
Thanks!