content: package com.example.demo.models;
  
  import org.springframework.data.annotation.Id;
  import org.springframework.data.mongodb.core.mapping.Document;
  import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
  
  @Document(collection = "users")
  public class User {
      @Id
      private String id;
      private String name;
      private String email;
      private String password;
  
      // Constructors
      public User() {}
  
      public User(String name, String email, String password) {
          this.name = name;
          this.email = email;
          this.setPassword(password); // Use setter to hash the password
      }
  
      // Getters and Setters
      public String getId() {
          return id;
      }
  
      public void setId(String id) {
          this.id = id;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public String getEmail() {
          return email;
      }
  
      public void setEmail(String email) {
          this.email = email;
      }
  
      public String getPassword() {
          return password;
      }
  
      public void setPassword(String password) {
          this.password = password;
      }
  }
  
  