title: Query with join between documents
body: <p>I would like to create a view in CouchDb which contains some fields from multiple linked documents.
  My documents are something like this:</p>
  
  <pre><code>/*Products:*/
  {
      "_id": "Products:ABC",
      "doctype": "Products",
      "productCode": "ABC",
      "description": "The best product you ever seen",
      "category_id": "Categories:1",
      "brand_id": "Brands:52"
  },
  {
      "_id": "Products:DEF",
      "doctype": "Products",
      "productCode": "DEF",
      "description": "DEFinitely a good product",
      "category_id": "Categories:2",
      "brand_id": "Brands:53"
  },
  
  /*Categories*/
  {
      "_id": "Categories:1",
      "categoryID": "1",
      "description": "Awesome products"
  },
  {
      "_id": "Categories:2",
      "categoryID": "2",
      "description": "Wonderful supplies"
  },
  
  /*Brands*/
  {
      "_id": "Brands:52",
      "brandID": "52",
      "description": "Best Items"
  },
  {
      "_id": "Brands:53",
      "brandID": "53",
      "description": "Great Gadgets"
  },
  </code></pre>
  
  <p>I would like to have a result like this:</p>
  
  <pre><code>/*View results: */
  {
      "id": "Products:ABC",
      "key": "Products:ABC",
      "value": {
          "productCode": "ABC",
          "description": "The best product you ever seen",
          "category": {
              "categoryID": "1",
              "description": "Awesome products"
          },
          "brand": {
              "brandID": "52",
              "description": "Best Items"
          }
      }
  },
  {
      "id": "Products:DEF",
      "key": "Products:DEF",
      "value": {
          "productCode": "DEF",
          "description": "DEFinitely a good product",
          "category": {
              "categoryID": "2",
              "description": "Wonderful supplies"
          },
          "brand": {
              "brandID": "53",
              "description": "Great Gadgets"
          }
      }
  },
  </code></pre>
  
  <p>The goal is to have a result that is a join between the three documents. Is it possibile?</p>
  
  <p>As you can imagine I come from the SQL world, so maybe I am designing the database terribly wrong, so any advice on how to change the documents structure is welcome!</p>
  
  <p>Thanks in advance!</p>
  
  <p>Francesco</p>