diff --git a/src/main/java/cc/fascinated/bat/model/BatGuild.java b/src/main/java/cc/fascinated/bat/model/BatGuild.java index a61c674..4f8d912 100644 --- a/src/main/java/cc/fascinated/bat/model/BatGuild.java +++ b/src/main/java/cc/fascinated/bat/model/BatGuild.java @@ -113,6 +113,7 @@ public class BatGuild extends ProfileHolder { * Saves the user */ public void save() { + org.bson.Document document = new org.bson.Document(); document.put("_id", id); document.put("createdAt", createdAt); @@ -124,7 +125,7 @@ public class BatGuild extends ProfileHolder { MongoService.INSTANCE.getGuildsCollection().replaceOne( new org.bson.Document("_id", id), - this.getDocument(), + document, new ReplaceOptions().upsert(true) ); } diff --git a/src/main/java/cc/fascinated/bat/model/BatUser.java b/src/main/java/cc/fascinated/bat/model/BatUser.java index 5f709b2..7acf7c4 100644 --- a/src/main/java/cc/fascinated/bat/model/BatUser.java +++ b/src/main/java/cc/fascinated/bat/model/BatUser.java @@ -103,6 +103,7 @@ public class BatUser extends ProfileHolder { * Saves the user */ public void save() { + org.bson.Document document = new org.bson.Document(); document.put("_id", id); document.put("createdAt", createdAt); @@ -114,7 +115,7 @@ public class BatUser extends ProfileHolder { MongoService.INSTANCE.getUsersCollection().replaceOne( new org.bson.Document("_id", id), - this.getDocument(), + document, new ReplaceOptions().upsert(true) ); }