controller.js
function(modelOrCollection, req, res, next) {
    if (!modelOrCollection) {
      return next();
    }

    if (modelOrCollection instanceof Model) {
      // Data is a Model
      res.data = modelOrCollection.render();
    } else if (modelOrCollection instanceof Collection) {
      // Data is a Collection
      res.data = modelOrCollection.render();
    } else {
      // Data is raw
      res.data = modelOrCollection;
    }

    return next();
  }
function(modelOrCollection, req, res, next) {
    if (!modelOrCollection) {
      return next();
    }

    if (modelOrCollection instanceof Model) {
      // Data is a Model
      res.data = modelOrCollection.render();
    } else if (modelOrCollection instanceof Collection) {
      // Data is a Collection
      res.data = modelOrCollection.render();
    } else {
      // Data is raw
      res.data = modelOrCollection;
    }

    return next();
  }
function ( modelOrCollection , req , res , next ) { if ( ! modelOrCollection ) { return next ( ) ; } if ( modelOrCollection instanceof Model ) { // Data is a Model res . data = modelOrCollection . render ( ) ; } else if ( modelOrCollection instanceof Collection ) { // Data is a Collection res . data = modelOrCollection . render ( ) ; } else { // Data is raw res . data = modelOrCollection ; } return next ( ) ; }
Attempt to render a Model or Collection
If input is not a Model or Collection, pass it thru unmodified

DEPRECATED 2015-06-08

@param {*} modelOrCollection
Attempt to render a Model or Collection If input is not a Model or Collection pass it thru unmodified