lib/db.js
function (callback) {
    var filterFunction = function (doc, req) {
      if (doc.userId === req.query.key) {
        return true;
      } else {
        return false;
      }
    };

    db.addFilter('profile_by_userId', filterFunction, function (err) {
      if (err) {
        return callback(err);
      }

      return callback();
    });
  }
function (callback) {
    var filterFunction = function (doc, req) {
      if (doc.userId === req.query.key) {
        return true;
      } else {
        return false;
      }
    };

    db.addFilter('profile_by_userId', filterFunction, function (err) {
      if (err) {
        return callback(err);
      }

      return callback();
    });
  }
function ( callback ) { var filterFunction = function ( doc , req ) { if ( doc . userId === req . query . key ) { return true ; } else { return false ; } } ; db . addFilter ( 'profile_by_userId' , filterFunction , function ( err ) { if ( err ) { return callback ( err ) ; } return callback ( ) ; } ) ; }
Profile userFilter
Profile userFilter