lib/routes/index.js
function (req, res) {
    var options = {
      operation: 'DISTINCT',
      res: res,
    };
    exports.distinct.before(req, res, options);
    vulpejs.models.distinct({
      model: req.params.model,
      query: req.params.query || {},
      sort: req.params.sort || false,
      array: req.params.array || false,
      callback: {
        success: function (items) {
          exports.distinct.after(req, res, items);
          res.json(items);
        },
        error: function (error) {
          vulpejs.log.error('DISTINCT', error);
          res.status(500).end();
        },
      },
    });
  }
function (req, res) {
    var options = {
      operation: 'DISTINCT',
      res: res,
    };
    exports.distinct.before(req, res, options);
    vulpejs.models.distinct({
      model: req.params.model,
      query: req.params.query || {},
      sort: req.params.sort || false,
      array: req.params.array || false,
      callback: {
        success: function (items) {
          exports.distinct.after(req, res, items);
          res.json(items);
        },
        error: function (error) {
          vulpejs.log.error('DISTINCT', error);
          res.status(500).end();
        },
      },
    });
  }
function ( req , res ) { var options = { operation : 'DISTINCT' , res : res , } ; exports . distinct . before ( req , res , options ) ; vulpejs . models . distinct ( { model : req . params . model , query : req . params . query || { } , sort : req . params . sort || false , array : req . params . array || false , callback : { success : function ( items ) { exports . distinct . after ( req , res , items ) ; res . json ( items ) ; } , error : function ( error ) { vulpejs . log . error ( 'DISTINCT' , error ) ; res . status ( 500 ) . end ( ) ; } , } , } ) ; }
Retrive distinct list of objects from database.
@param {Object} req Request
@param {Object} res Response
Retrive distinct list of objects from database .