title: How to perform this query on a hash in a MongoDB document (using Mongoid)
body: <p>I am using Mongoid. I have a document that looks like the following:</p>
  
  <pre><code>Pet:
    foo: {bar: 1, foobar: 2}
    another_attr: 1
  </code></pre>
  
  <p>In this case, preferably using Mongoid, how would I query for all pets that have a bar value greater than 0 where another_attr is equal to 1?</p>