Skip to content

Commit 68057c4

Browse files
authored
refactor: minor changes to remove mongo deprecation warnings (#7626)
1 parent 936b5ec commit 68057c4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Adapters/Storage/Mongo/MongoStorageAdapter.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ export class MongoStorageAdapter implements StorageAdapter {
180180
delete this.connectionPromise;
181181
return;
182182
}
183-
database.on('error', () => {
183+
client.on('error', () => {
184184
delete this.connectionPromise;
185185
});
186-
database.on('close', () => {
186+
client.on('close', () => {
187187
delete this.connectionPromise;
188188
});
189189
this.client = client;
@@ -555,7 +555,7 @@ export class MongoStorageAdapter implements StorageAdapter {
555555
return this._adaptiveCollection(className)
556556
.then(collection =>
557557
collection._mongoCollection.findOneAndUpdate(mongoWhere, mongoUpdate, {
558-
returnOriginal: false,
558+
returnDocument: 'after',
559559
session: transactionalSession || undefined,
560560
})
561561
)

0 commit comments

Comments
 (0)