Spaces:
Sleeping
Sleeping
| import mongoose from "mongoose"; | |
| const entrySchema = new mongoose.Schema( | |
| { | |
| cardId: { | |
| type: mongoose.Schema.Types.ObjectId, | |
| required: true, | |
| ref: "Card" | |
| }, | |
| question: { | |
| type: String, | |
| required: true, | |
| trim: true | |
| }, | |
| answer: { | |
| type: String, | |
| required: true | |
| }, | |
| order: { | |
| type: Number, | |
| default: 0 | |
| } | |
| }, | |
| { | |
| timestamps: true | |
| } | |
| ); | |
| export const Entry = mongoose.model("Entry", entrySchema); | |