diff --git a/Sources/FluentMongo/MongoConnection.swift b/Sources/FluentMongo/MongoConnection.swift index 8f2a049..8cc1c7a 100644 --- a/Sources/FluentMongo/MongoConnection.swift +++ b/Sources/FluentMongo/MongoConnection.swift @@ -129,6 +129,10 @@ public final class MongoConnection: BasicWorker, DatabaseConnection, DatabaseQue return ["_id": ["$in": identifiers] as Document] } + + deinit { + self.close() + } } // MARK: - Internal Indexing Helpers