title: node.js with express how to remove the query string from the url
body: <p>I have a button that is performing a get to my page and adding a filter to the query string. My code applies that filter to the grid but the user can remove/edit that filter.  Since they can see what filter was applied in the grid, I would like to remove the <code>?filter=blah</code> from the query string when the page is displayed.</p>
  <p>It might be confusing if on the page and the URL says <code>?filter=columnA</code> which is correct initially, but the user removes that filter and applies a new one on <code>columnB</code> but the query string still says <code>?filter-columnA</code>. The grid can handle changing filters without needing a post back.</p>
  <p>How can I do that?  And if you cannot remove/update a query string, is it possible to parse it and then just redirect to the main page without the query string?  Once I have the filter saved to var filter, I no longer need it in the query string.</p>
  <p>here is the code that displays the page:</p>
  <pre><code>exports.show = function(req, res) {
      var filter = req.query.filter;
      if (filter === null || filter === &quot;&quot;) {
          filter = &quot;n/a&quot;;
      }
      
      res.render(&quot;somepage.jade&quot;, {
              locals: {
                  title: &quot;somepage&quot;,
                  filter: filter
              }
      });
  
  };
  </code></pre>