title: Conditions in WHERE clause in Couchbase
body: <p>I am newbie to couchbase. Cannot find online what I am trying to achieve.</p>
  
  <p>I am trying to use condition for specific document type. My condition will be like this - if document type is 'type1' then find specific id in that document and document type 'type2' then find another id in that document type only. My query is like below -</p>
  
  <pre><code>SELECT DISTINCT appDetail.id, appDetail.group_id_record
  FROM default appDetail
  LEFT JOIN default users ON KEYS appDetail.id
  LEFT JOIN default groups ON KEYS ARRAY 'app_detail::' || TO_STRING(c) FOR c 
  IN appDetail.group_id_record END
  WHERE (appDetail.type = 'user' OR appDetail.type = 'app_detail')
  </code></pre>
  
  <p>I assume I need additional condition in JOIN may be?</p>