title: Searching MongoDB with Rails
body: <p>I am using ruby 1.9.3p194 and rails 3.2.5
  when i do</p>
  
  <pre><code>@authors = Author.all
  </code></pre>
  
  <p>it works fine by outputing all name from my database.
  But</p>
  
  <pre><code>@authors = Author.where("name like ?", "%#{params[:q]}%")
  </code></pre>
  
  <p>is not working. I am using Mongodb. I want to output the name(Ram) when i input R.
  What could be the solution?</p>
  
  <hr>
  
  <p>By this method i can search params[:q] through my field :name only. How can i add other field name also such i want to seach this params[:q] in text field :role , :email also at once? I used || but it gives error.
  I have to write this in comment but since my comment list is long . I ask this question here.
  Sorry for that.</p>