diff --git a/src/main/java/me/braydon/feather/database/impl/mongodb/MongoRepository.java b/src/main/java/me/braydon/feather/database/impl/mongodb/MongoRepository.java index c1934ae..bd3dac2 100644 --- a/src/main/java/me/braydon/feather/database/impl/mongodb/MongoRepository.java +++ b/src/main/java/me/braydon/feather/database/impl/mongodb/MongoRepository.java @@ -37,8 +37,12 @@ public class MongoRepository extends Repository { @NonNull private final MongoCollection collection; public MongoRepository(@NonNull MongoDB database, @NonNull Class entityClass, @NonNull String collectionName) { + this(database, entityClass, database.getDatabase().getCollection(collectionName)); + } + + public MongoRepository(@NonNull MongoDB database, @NonNull Class entityClass, @NonNull MongoCollection collection) { super(database, entityClass); - collection = database.getDatabase().getCollection(collectionName); // Get the collection by the name + this.collection = collection; } /**