title: Associative search in rails with mongodb
body: <p>i would like to perform a search in rails form with backend mongoDb, and in my model named employee data where first name, i need to search salary in another table, and i gave relation to employee data as " belongs to salary ".i tried a lot figure it out how to give association.</p>
  
  <pre><code>def self.search(search)
  
    any_of({firstname: /#{search}/i })
  
  end
  </code></pre>