{"size": 388, "ext": "js", "max_stars_repo_path": "models/User.js", "max_stars_repo_name": "R00GER/mern-movie-database-backend", "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": "R00GER/mern-movie-database-backend", "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": "R00GER/mern-movie-database-backend", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.25, "max_line_length": 63, "alphanum_fraction": 0.6469072165}
import mongoose from "mongoose";

const userSchema = mongoose.Schema({
  username: { type: String, required: true, minLength: 4 },
  email: { type: String, required: true },
  passwordHash: { type: String, required: true, minLength: 8 },
  movies: [
    {
      type: mongoose.Schema.Types.ObjectId,
      ref: "Movie",
    },
  ],
});

export default mongoose.model("User", userSchema);
