lib/predefine.js
function map(d) {
      if (isModel(d)) return pluck(d.attributes);

      for (var key in d) {
        if (isCollection(d[key])) {
          d[key] = pluck(d[key].models);
        }

        if (isModel(d[key])) {
          //
          // Delete MongoDB ObjectIDs. The stored state of the model is ambigious
          // as the referenced model could have different values in its own
          // collection. Hence doing recursive storage should be limited as much
          // as possible, since duplicate data will be stored.
          //
          d[key] = pluck(d[key].attributes);
          delete d[key]._id;
        }
      }

      return d;
    }
function map(d) {
      if (isModel(d)) return pluck(d.attributes);

      for (var key in d) {
        if (isCollection(d[key])) {
          d[key] = pluck(d[key].models);
        }

        if (isModel(d[key])) {
          //
          // Delete MongoDB ObjectIDs. The stored state of the model is ambigious
          // as the referenced model could have different values in its own
          // collection. Hence doing recursive storage should be limited as much
          // as possible, since duplicate data will be stored.
          //
          d[key] = pluck(d[key].attributes);
          delete d[key]._id;
        }
      }

      return d;
    }
function map ( d ) { if ( isModel ( d ) ) return pluck ( d . attributes ) ; for ( var key in d ) { if ( isCollection ( d [ key ] ) ) { d [ key ] = pluck ( d [ key ] . models ) ; } if ( isModel ( d [ key ] ) ) { // // Delete MongoDB ObjectIDs. The stored state of the model is ambigious // as the referenced model could have different values in its own // collection. Hence doing recursive storage should be limited as much // as possible, since duplicate data will be stored. // d [ key ] = pluck ( d [ key ] . attributes ) ; delete d [ key ] . _id ; } } return d ; }
Recursive mapping function.

@param {Object} d Collection, Model or plain object.
@returns {Object} plucked object
@api private
Recursive mapping function .