Initial commit
This commit is contained in:
17
src/schemas/Key.ts
Normal file
17
src/schemas/Key.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { ObjectId, Schema, model } from "mongoose"
|
||||
|
||||
interface IKey {
|
||||
room: string;
|
||||
whom: ObjectId;
|
||||
borrow: Date;
|
||||
tb?: Date;
|
||||
}
|
||||
|
||||
const keySchema = new Schema<IKey>({
|
||||
room: {type: String, required: true},
|
||||
whom: {type: Schema.Types.ObjectId, ref: "logins", required: true},
|
||||
borrow: {type: Date, default: Date.now, required: true},
|
||||
tb: {type: Date}
|
||||
})
|
||||
|
||||
export default model("key", keySchema)
|
||||
Reference in New Issue
Block a user