title: can I use a lat / long pair on a nodejs REST endpoint?
body: <p>my MEAN stack app is requesting user data based on a lon / lat coordinate. I currently send the coordinates via POST from an angularjs service to this expressjs route and handler: </p>
  
  <pre><code>getUsers = function(req, res) {
      var lonlat = req.body;
  
      // 2D spatial query
      return UserModelRef.find({'location': { $near: lonlat }}, function (err, data) {
           ...
  }   
  
  app.post('/user', getUsers);
  </code></pre>
  
  <p>This works but I'd prefer to do a GET along these lines:</p>
  
  <pre><code>getUsers = function(req, res) {
      var lonlat = req.params.location;
  
      // 2D spatial query
      return UserModelRef.find({'location': { $near: lonlat }}, function (err, data) {
          ...
  }
  
  app.get('/user/:location', getUsers);   
  </code></pre>
  
  <p>but this request (http.get /user/-73.6398,40.7469) results in a Mongo error since the $near operator requires an object. Is there a way for the handler to convert the coordinates to an object that $near can use?  </p>
  
  <p>My goal is to treat the 2D coordinate pair like any other GET route parameter.</p>