Spaces:
Sleeping
Sleeping
File size: 479 Bytes
81fc505 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 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);
|