Problem to query MongoDB through collection.find from simple text box in browser page

I use a mongodb database where I have its internal log data. With Express, Node and Monk (following this guide) I have to try to get data from a search text box, and I stopped on how to request this data.

from the userlist.ejs page I have implemented a form where I send a GET request:


where then I go to get name through

`search =` 

and then insert it into the collection.find({search}…

below is the index.js:

    /* GET Userlist page. */
    router.get('/userlist', function(req, res) {

        search =;

        var db = req.db;
        var collection = db.get('startup_log');
            res.render('userlist', {
              "userlist" : docs

this is the userlist.ejs page where I send the request. which later should display it through the for loop after processing it from index.ejs,

     <!DOCTYPE html>
         <title>User List</title>
         <link rel='stylesheet' href='/stylesheets/style.css' />
         <h1>User List</h1>

         <input type="text" id="titles" />

    <form action="/userlist" method="GET" encType="multipart/form-data">
      <label htmlFor="newNote">New Note:</label>
        <input type="text" name="name"  className="form-control" rows="5" 
         id="name" placeholder="5044"></input>
        <button id="done" type="submit" className="btn btn-primary pull- 
        <button id="cancel" className="btn btn-warning pull- 

        <% for (var i = 0; i < userlist.length; i++) {%>
        <li><%= userlist[i].hostname %></li>

i can’t figure out how to pass to collection.find the query i enter in the text box! any help would be appreciated as I cannot find specific information about my case. Thanks in advance!