title: node.js - MongoError: Can't canonicalize query: BadValue bad order array [2]
body: <p>I have a database with the following document structure:</p>
  
  <pre class="lang-js prettyprint-override"><code>{
      "_id" : ObjectId("520bea012ab230549e749cff"),
      "Day" : 1,
      "Time" : 54,
      "State" : "Vermont",
      "Airport" : "BTV",
      "Temperature" : 39,
      "Humidity" : 57,
      "Wind Speed" : 6,
      "Wind Direction" : 170,
      "Station Pressure" : 29.6,
      "Sea Level Pressure" : 150
  }
  </code></pre>
  
  <p>I need to find the most high 'Temperature' for each 'State' (i.e. e.g. there are 100 document with 'State':'Vermont') and add entry 'month_high':true into this document (that has the most high temperature)</p>
  
  <p>Here is my code: <a href="http://pastebin.com/UbACLbSF" rel="nofollow">http://pastebin.com/UbACLbSF</a></p>
  
  <p>But when I run the program in shell I get the following error:</p>
  
  <blockquote>
    <p>MongoError: Can't canonicalize query: BadValue bad order array [2]</p>
  </blockquote>