title: writing complex query in mongo DB
body: <p>I want to write complex query in mongodb using following fields :</p>
  
  <ul>
  <li>class</li>
  <li>rate</li>
  <li>hrs</li>
  </ul>
  
  <p>the query should return me result sets based upon the following conditions:</p>
  
  <p>1) <code>class = "a" &amp;&amp; rate &gt; "20000"</code></p>
  
  <p>OR</p>
  
  <p>2) <code>class = "b" &amp;&amp; (rate X hrs X 52) &gt; "20000"</code></p>
  
  <p>The records in the collection am trying to query looks something like this:</p>
  
  <pre><code>{
      "_id": "3434sfsf",
      "rate": "60",
      "class": "a"
  },
  {
      "_id": "sdsdsd",
      "rate": "60",
      "class": "b",
      "hrs": "8"
  }
  </code></pre>
  
  <p>How can I write my query to achieve what am looking for... Thanks!</p>