title: what better/faster complex couchbase ID's or inline document type="my_document_type"
body: <p>My current id keys contains from 3 or 4 segments:</p>
  
  <pre><code>namespace::my_key::id
  namespace::my_key::my_second_key::id
  </code></pre>
  
  <p>Solution 1.
  Use complex id's and create views by searching in id for a key</p>
  
  <pre><code>function (doc, meta) {
  
    if(meta.id.indexOf("::my_key::") !== -1){
      emit([doc.source_id], [doc.name,doc.title,doc.ui]);
    }
  
  
  }
  </code></pre>
  
  <p>Solution 2.
  For every document add fields like "type", "namespace" 
  And creat views using them</p>
  
  <pre><code>function (doc, meta) {
  
    if(doc.type=='my_key'){
      emit([doc.source_id], [doc.name,doc.title,doc.ui]);
    }
  
  
  }
  </code></pre>
  
  <p>If i choose Solution 2, 
  I have to maintain id's on my application and probably i will do as in solution 1.</p>
  
  <p>Does anyone have experience in naming id's and creating views from them? 
  what problems you had with each of these solutions.
  Or maybe indexOf() function is not recommended?</p>