{"size": 1102, "ext": "js", "max_stars_repo_path": "models/User.js", "max_stars_repo_name": "qmsparks/assembleIt", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "models/User.js", "max_issues_repo_name": "qmsparks/assembleIt", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "models/User.js", "max_forks_repo_name": "qmsparks/assembleIt", "max_forks_repo_forks_event_min_datetime": "2020-09-25T14:31:16.000Z", "max_forks_repo_forks_event_max_datetime": "2020-11-02T17:07:03.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 4, "avg_line_length": 29.7837837838, "max_line_length": 132, "alphanum_fraction": 0.5462794918}
const mongoose = require('mongoose');

const userSchema = new mongoose.Schema(
    {
        username: {type: String, required: [true, 'you must provide a username.'], minlength: 4, maxlength: 16, unique: true },
        password: {type: String, required: true},
        email: {type: String, required: true, unique: true},
        isVerified: { type: Boolean }, // for token verification, default: false once the token routes are set up
        karma: {type: Number, default: 0},
        profilePic: {type: String, default: 'https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_1280.png'},
        posts: [
            // reference
            {
              type: mongoose.Schema.Types.ObjectId,
              ref: "Post",
            },
          ],
          comments: [
            // reference
            {
              type: mongoose.Schema.Types.ObjectId,
              ref: "Comment",
            },
          ],
    },
    {
        timestamps: true,
        createdAt: "signupAt"
    }
);


const User = mongoose.model('User', userSchema);


module.exports = User;
