These are chat archives for Automattic/mongoose

27th
Nov 2015
Erinç Fırtına
@EricMcRay
Nov 27 2015 09:53
@diegoaguilar for errors you need to use catch method after then
fixed code:
  var pattern = new RegExp(request.query.pattern, 'ig');
  Item.find('name', pattern).execAsync()
    .then(function (items) {
      return response.json(items);
    })
    .catch(function (err) {
      return response.status(500).json(err);
    });
Diego Aguilar Aguilar
@diegoaguilar
Nov 27 2015 13:14
thanks @EricMcRay