From 9af387ca56a9f035e3063f5d12ef574eb4e28330 Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 25 Apr 2024 06:42:26 +0100 Subject: [PATCH] make index unique --- src/main/java/cc/fascinated/backend/model/score/Score.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/cc/fascinated/backend/model/score/Score.java b/src/main/java/cc/fascinated/backend/model/score/Score.java index 8c5fe16..bcb8f53 100644 --- a/src/main/java/cc/fascinated/backend/model/score/Score.java +++ b/src/main/java/cc/fascinated/backend/model/score/Score.java @@ -19,7 +19,7 @@ import java.util.List; * A score for an account. */ @Document -@CompoundIndex(name = "accountId_leaderboardId", def = "{'accountId' : 1, 'leaderboardId' : 1}") +@CompoundIndex(name = "accountId_leaderboardId", def = "{'accountId' : 1, 'leaderboardId' : 1}", unique = true) @AllArgsConstructor @Getter @Setter public class Score { /**