title: How to query mongodb using the input provided by the user in text fields using nodejs and mongoose?
body: <p>I am using nodejs to access the mongodb.I am able to query it statically by directly specifying the field values,but i want to query it using the values user will enter it,how should i proceed with it.This is my html file where i am accepting location and time value from the user ,and the get method is called in form action to the specified url:<a href="http://localhost:3000/movies,where" rel="nofollow noreferrer">http://localhost:3000/movies,where</a> I have added the find() query to retrieve all the records from the collection such as:</p>
  
  <pre><code>     var query={'location':"//the location which user will enter in textbox"};
       db.collection("movie").find(query);
  </code></pre>
  
  <p>My form:</p>
  
  <pre><code>&lt;html&gt;
     &lt;body&gt;
  
        &lt;form action = "http://localhost:3000/movies"&gt;
           First Name: &lt;input type = "text" name = "location"&gt;  &lt;br&gt;
           Last Name: &lt;input type = "text" name = "timing"&gt;
           &lt;input type = "submit" value = "Submit"&gt;
        &lt;/form&gt;
  
     &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Help me how can I acheive this?
  Thanks!</p>