UNPKG

557 BPlain TextView Raw
1import * as bcrypt from "bcrypt-nodejs";
2import * as crypto from "crypto";
3import * as mongoose from "mongoose";
4import { ObjectId } from "mongodb";
5
6const configSchema = new mongoose.Schema({
7 Name: { type: String, unique: true },
8 Config: Object,
9}, { timestamps: true });
10
11/**
12 * pre save config middleware.
13 */
14configSchema.pre("save", function save(next) {
15 const config = this;
16 // if (!config.isModified("password")) { return next(); }
17 next();
18});
19
20const Config = mongoose.model("Config", configSchema);
21
22export { Config };
\No newline at end of file