title: Dynamic Mongoose Find using AND style query
body: <p>I have a situation where the user may enter multiple constraints to return back results on.  I am trying to perform a "find" in mongoose that I can perform multiple "and"s on. I thought the first block below would return back my results but rather it returns back all results currently in my db. My end goal I was trying to achieve is from the two hex value entries of both "5B6D8B" AND "BA4D2A" provide me the path only if the perc >= 5.  If I just pass "{hex: "5B6D8B", 'img.perc': {$gte: 5} }" to find it pulls back a single result which is correct. </p>
  
  <pre><code>clrModel.find([{hex: "5B6D8B", 'img.perc': {$gte: 5} },
  {hex: "BA4D2A", 'img.perc': {$gte: 5} }] ,'img.path', function(error,data){});
  </code></pre>
  
  <p>The second part to this is I would like to, if possible, build the value passed to "find" dynamically. It seems that I can't pass it as a string as it doesn't work.  Any ideas on how I can achieve this?  The below block is what I was trying to do but it doesnt work. Unsure if it will help in better understanding what I was attempting to do. "finalFind" that is shown below is the result I would pass as the first param to the find query.  Thanks in advance!</p>
  
  <pre><code>var hex, perc, finalFind = '{';
  for(var i = 0; i &lt; numIndicies; i++){
      finalFind += '{hex:"' + hexArr[i] + '", {perc: {$gte:' + percArr[i] + '}}}';
      //Handle our end character
      if(i !== numIndicies-1)
          finalFind += ',';
      else
          finalFind += '}';
  }
  </code></pre>
  
  <p>------- Edit Below Showing Document Example --------</p>
  
  <p>The below item is representative of a document entry</p>
  
  <pre><code>{
      "__v": 0,
      "_id": {
          "$oid": "51c1ac95f502f20969000022"
      },
      "hex": "BA4D2A",
      "img": [
          {
              "path": "http://example.com/image1.jpg",
              "perc": 10,
              "_id": {
                  "$oid": "51c1ac95f502f20969000023"
              }
          },
          {
              "path": "http://example.com/image2.jpg",
              "perc": 20,
              "_id": {
                  "$oid": "51c1ac95f502f20969000034"
              }
          }
      ]
  }
  </code></pre>