title: MongoDB $gt/$lt operators with prices stored as strings
body: <p>I'm trying to query my database for prices greater than/less than a user specified number. In my database, prices are stored like so:</p>
  
  <pre><code>{price: "300.00"}
  </code></pre>
  
  <p>According to the docs, this should work:</p>
  
  <pre><code>db.products.find({price: {$gt:30.00}}).pretty()
  </code></pre>
  
  <p>But I get no results returned. I've also tried <code>{price: {$gt:30}}</code>.</p>
  
  <p>What am I missing here?</p>
  
  <p>It it because the prices are stored as a string rather than a number in the DB? Is there a way around this?</p>