diff options
-rw-r--r-- | models/feedback/feedback.model.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/models/feedback/feedback.model.ts b/models/feedback/feedback.model.ts index 793f8da..b21747b 100644 --- a/models/feedback/feedback.model.ts +++ b/models/feedback/feedback.model.ts @@ -1,5 +1,7 @@ import { Model, model } from 'mongoose'; import { FeedbackSchema, feedbackSchema } from './feedback.schema'; +feedbackSchema.index({ version: 1, authorId: 1 }, { unique: true }); // Unique together + export default model<FeedbackSchema, Model<FeedbackSchema>>('Feedback', feedbackSchema); |