23 lines
589 B
TypeScript
23 lines
589 B
TypeScript
// create jawaban model using mongoose
|
|
import mongoose, { Document, Schema } from 'mongoose';
|
|
|
|
export interface Jawaban extends Document {
|
|
nis: string;
|
|
jawaban: string;
|
|
soal: string;
|
|
waktu: Date;
|
|
}
|
|
|
|
const JawabanSchema = new Schema(
|
|
{
|
|
nis: { type: String, required: true },
|
|
jawaban: { type: String, required: true },
|
|
soal: { type: String, required: true },
|
|
waktu: { type: Date, required: true },
|
|
},
|
|
{
|
|
collection: 'jawaban_soal'
|
|
}
|
|
);
|
|
|
|
export const JawabanSoalModel = mongoose.model<Jawaban>('Jawaban', JawabanSchema); |