This repository offers custom schema types for Mongoose, designed to elevate the functionality and security of your MongoDB schemas. Simplify database interactions and ensure robust data validation with these specialized schema types.
To install, use npm:
npm install git+https://github.com/sikandarmoyaldev/mongoose-schema-types.git
Example Usage
import mongoose from "mongoose";
import { Password } from "mongoose-schema-types"
const UserSchema = new mongoose.Schema({
username: {
type: String,
required: true,
},
password: {
type: Password,
required: true
}
});
const User = mongoose.model("User", UserSchema);
export default User;
- Password: Hashes passwords securely using bcrypt for storage.
If you want to contribute to this project, feel free to fork the repository, make changes, and submit a pull request. Please make sure to review the Contribution Guidelines before contributing.