Module: models/userModel

Defines the Mongoose schema and model for a User.

Source:

Requires

  • module:mongoose
  • module:bcryptjs

Members

(inner, constant) User :mongoose.Model.<User>

The Mongoose model for a User, compiled from the userSchema.

Type:
  • mongoose.Model.<User>
Source:

(inner, constant) userSchema :mongoose.Schema.<User>

Mongoose schema for the User collection.

Type:
  • mongoose.Schema.<User>
Source:

Type Definitions

User

Properties:
Name Type Description
name string

The name of the user (required).

email string

The unique email of the user (required).

password string

The hashed password of the user (required).

role "user" | "admin"

The role of the user (defaults to "user").

createdAt Date

Timestamp when the user was created (auto-generated).

updatedAt Date

Timestamp when the user was last updated (auto-generated).

Source: