Download src/models/User.ts from ItsMa8di/idbot: direct link, hf CLI and curl.
- Browser
- Download file 741 Bytes
-
https://huggingface.co/spaces/ItsMa8di/idbot/resolve/main/src/models/User.ts
- Command line
-
hf download hf://spaces/ItsMa8di/idbot/src/models/User.ts
-
curl -L -o User.ts https://huggingface.co/spaces/ItsMa8di/idbot/resolve/main/src/models/User.ts
741 Bytes
| import mongoose, { Document, Model, Schema } from "mongoose"; | |
| interface IUser { | |
| userid: number; | |
| username?: string; | |
| firstname?: string; | |
| lastname?: string; | |
| isPremium: boolean; | |
| savedAccountTag?: string; | |
| createdAt: Date; | |
| } | |
| interface IUserModel extends IUser, Document {} | |
| const userSchema: Schema = new Schema<IUser>({ | |
| userid: { type: Number, required: true, unique: true }, | |
| username: { type: String }, | |
| firstname: { type: String }, | |
| lastname: { type: String }, | |
| isPremium: { type: Boolean, requried: true, default: false }, | |
| savedAccountTag: { type: String }, | |
| createdAt: { type: Date, default: Date.now() }, | |
| }); | |
| const UserModel: Model<IUser> = mongoose.model<IUser>("Users", userSchema); | |
| export { IUser, UserModel }; | |