{"size": 554, "ext": "js", "max_stars_repo_path": "src/server/models/user.js", "max_stars_repo_name": "NeoPhi/jellyHTML5", "max_stars_repo_stars_event_min_datetime": "2019-07-01T17:40:13.000Z", "max_stars_repo_stars_event_max_datetime": "2019-07-01T17:40:13.000Z", "max_issues_repo_path": "src/server/models/user.js", "max_issues_repo_name": "NeoPhi/jellyHTML5", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/server/models/user.js", "max_forks_repo_name": "NeoPhi/jellyHTML5", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 17.8709677419, "max_line_length": 57, "alphanum_fraction": 0.6913357401}
var mongoose = require('mongoose');

var UserModel;
var UserSchema = mongoose.Schema({
  dailyCredId: {
    type: String,
    unique: true,
    sparse: true
  },
  email: {
    type: String,
    required: true
  },
  picture: {
    type: String
  }
});

function findByDailyCredId(dailyCredId, callback) {
  UserModel.findOne({
    dailyCredId: dailyCredId
  }, callback);
}

UserSchema.statics.findByDailyCredId = findByDailyCredId;

UserModel = mongoose.model('User', UserSchema);

module.exports.schema = UserSchema;
module.exports.model = UserModel;
