lib/routes/index.js
function (req, res, options) {
    if (!options) {
      options = {};
    }
    options.operation = 'FIND';
    options.res = res;
    exports.find.before(req, res, options);
    vulpejs.models.find({
      model: req.params.model,
      populate: req.params.populate,
      history: true,
      id: req.params.id || false,
      query: req.params.query || {
        _id: req.params.id,
      },
      callback: {
        success: function (data) {
          exports.find.after(req, res, data);
          if (options && options.callback) {
            vulpejs.utils.execute(options.callback, {
              item: data.item,
              history: data.history,
              res: res,
            });
          } else {
            res.json(data);
          }
        },
        error: function (error) {
          exports.response.error(options, error);
        },
      },
    })
  }
function (req, res, options) {
    if (!options) {
      options = {};
    }
    options.operation = 'FIND';
    options.res = res;
    exports.find.before(req, res, options);
    vulpejs.models.find({
      model: req.params.model,
      populate: req.params.populate,
      history: true,
      id: req.params.id || false,
      query: req.params.query || {
        _id: req.params.id,
      },
      callback: {
        success: function (data) {
          exports.find.after(req, res, data);
          if (options && options.callback) {
            vulpejs.utils.execute(options.callback, {
              item: data.item,
              history: data.history,
              res: res,
            });
          } else {
            res.json(data);
          }
        },
        error: function (error) {
          exports.response.error(options, error);
        },
      },
    })
  }
function ( req , res , options ) { if ( ! options ) { options = { } ; } options . operation = 'FIND' ; options . res = res ; exports . find . before ( req , res , options ) ; vulpejs . models . find ( { model : req . params . model , populate : req . params . populate , history : true , id : req . params . id || false , query : req . params . query || { _id : req . params . id , } , callback : { success : function ( data ) { exports . find . after ( req , res , data ) ; if ( options && options . callback ) { vulpejs . utils . execute ( options . callback , { item : data . item , history : data . history , res : res , } ) ; } else { res . json ( data ) ; } } , error : function ( error ) { exports . response . error ( options , error ) ; } , } , } ) }
Find object in database.
@param {Object} req Request
@param {Object} res Response
@param {Object} options {model, populate, callback}
Find object in database .