bug4882: Changed replaceOne() to updateOne() in MongoObjectFactoryImpl.renameEvent() and .renameLeaderBoardGroup

This commit is contained in:
Alessandro Stoltenberg committed 2019-01-26 23:04:36 +01:00
1 parent 43550d1569
commit c7ab12bb29
1 file changed
+2 -2
@@ -549,7 +549,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
MongoCollection<Document> leaderboardGroupCollection = database.getCollection(CollectionNames.LEADERBOARD_GROUPS.name());
Document query = new Document(FieldNames.LEADERBOARD_GROUP_NAME.name(), oldName);
Document update = new Document("$set", new Document(FieldNames.LEADERBOARD_GROUP_NAME.name(), newName));
leaderboardGroupCollection.withWriteConcern(WriteConcern.ACKNOWLEDGED).replaceOne(query, update, new UpdateOptions().upsert(true));
leaderboardGroupCollection.withWriteConcern(WriteConcern.ACKNOWLEDGED).updateOne(query, update, new UpdateOptions().upsert(true));
}
@Override
@@ -647,7 +647,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
MongoCollection<Document> eventCollection = database.getCollection(CollectionNames.EVENTS.name());
Document query = new Document(FieldNames.EVENT_ID.name(), id);
Document renameUpdate = new Document("$set", new Document(FieldNames.EVENT_NAME.name(), newName));
eventCollection.withWriteConcern(WriteConcern.ACKNOWLEDGED).replaceOne(query, renameUpdate, new UpdateOptions().upsert(true));
eventCollection.withWriteConcern(WriteConcern.ACKNOWLEDGED).updateOne(query, renameUpdate, new UpdateOptions().upsert(true));
}
@Override