refactor: minor changes to remove mongo deprecation warnings (#7626)

This commit is contained in:
Antoine Cormouls
2021-10-17 21:16:24 +02:00
committed by GitHub
parent 936b5ec9a7
commit 68057c49f3

View File

@@ -180,10 +180,10 @@ export class MongoStorageAdapter implements StorageAdapter {
delete this.connectionPromise; delete this.connectionPromise;
return; return;
} }
database.on('error', () => { client.on('error', () => {
delete this.connectionPromise; delete this.connectionPromise;
}); });
database.on('close', () => { client.on('close', () => {
delete this.connectionPromise; delete this.connectionPromise;
}); });
this.client = client; this.client = client;
@@ -555,7 +555,7 @@ export class MongoStorageAdapter implements StorageAdapter {
return this._adaptiveCollection(className) return this._adaptiveCollection(className)
.then(collection => .then(collection =>
collection._mongoCollection.findOneAndUpdate(mongoWhere, mongoUpdate, { collection._mongoCollection.findOneAndUpdate(mongoWhere, mongoUpdate, {
returnOriginal: false, returnDocument: 'after',
session: transactionalSession || undefined, session: transactionalSession || undefined,
}) })
) )