title: Couchbase Multiple Keys
body: <p>I presume a simple question. I have the following data. <img src="https://i.stack.imgur.com/KXSSQ.jpg" alt=""></p>
  
  <p>I want to search for all rows where the ID is > 2 but &lt; 8 and the Price is > 30</p>
  
  <p>I have used various versions of: <code>startkey=["2", null]</code> or even something like <code>startkey=["2", "30"]</code> just for testing. </p>
  
  <p>It only ever seems to run both conditions on the first row. So if I do: <code>startkey=["2", "30"]</code> then I get back:</p>
  
  <pre><code>{"id":"3","key":["3","30"],"value":null},
  {"id":"4","key":["4","30"],"value":null},
  {"id":"5","key":["5","20"],"value":null},
  {"id":"6","key":["6","60"],"value":null},
  {"id":"8","key":["8","60"],"value":null}
  </code></pre>
  
  <p>Why is row 5 there?</p>
  
  <p>I am starting to get the view that I need to handle this in the code (.net) and make multiple calls somehow... I can't seem to find anything on this that works....</p>
  
  <p>Note: I have tried doing say a loop with <code>for (i = 0; i &lt; doc.ID.length; i++)</code> and then using <code>doc.ID[i]</code> but it never returns anything....</p>
  
  <p>Currently I just have</p>
  
  <pre><code>function (doc, meta) {
      emit([doc.ID, doc.Price ],null);
  }
  </code></pre>
  
  <p>Essentially I want to have a search where there are 5 input keys that a user has. So do I need to make 5 calls and then keep taking data from the previous output as the source for the next??? </p>
  
  <p>Other references I have looked at include: the manual </p>
  
  <p>Thanks in advance,</p>
  
  <p>Kindest Regards
  Robin</p>