From 77a8520d2d63183dfba8207a228da226b6bad22a Mon Sep 17 00:00:00 2001 From: Antoine Cormouls Date: Thu, 14 Oct 2021 14:42:51 +0200 Subject: [PATCH 1/4] refactor: mongo deprecation warnings on database connect and returnOriginal --- .prettierignore | 1 + CHANGELOG.md | 1 + src/Adapters/Storage/Mongo/MongoStorageAdapter.js | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..2e1fa2d52e --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +*.md \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index c876810e6b..2254866736 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -174,6 +174,7 @@ ___ - refactor: deprecate `Parse.Cloud.httpRequest`; it is recommended to use a HTTP library instead. (Daniel Blyth) [#7595](https://github.com/parse-community/parse-server/pull/7595) - refactor: Modernize HTTPRequest tests (brandongregoryscott) [#7604](https://github.com/parse-community/parse-server/pull/7604) - Allow liveQuery on Session class (Daniel Blyth) [#7554](https://github.com/parse-community/parse-server/pull/7554) +- Fix Mongo deprecation warnings on database connect and returnOriginal (Moumouls) [#7626](https://github.com/parse-community/parse-server/pull/7626) # 4.10.4 [Full Changelog](https://github.com/parse-community/parse-server/compare/4.10.3...4.10.4) diff --git a/src/Adapters/Storage/Mongo/MongoStorageAdapter.js b/src/Adapters/Storage/Mongo/MongoStorageAdapter.js index 39cbcb5db8..e134f0c06f 100644 --- a/src/Adapters/Storage/Mongo/MongoStorageAdapter.js +++ b/src/Adapters/Storage/Mongo/MongoStorageAdapter.js @@ -180,10 +180,10 @@ export class MongoStorageAdapter implements StorageAdapter { delete this.connectionPromise; return; } - database.on('error', () => { + client.on('error', () => { delete this.connectionPromise; }); - database.on('close', () => { + client.on('close', () => { delete this.connectionPromise; }); this.client = client; @@ -555,7 +555,7 @@ export class MongoStorageAdapter implements StorageAdapter { return this._adaptiveCollection(className) .then(collection => collection._mongoCollection.findOneAndUpdate(mongoWhere, mongoUpdate, { - returnOriginal: false, + returnDocument: 'after', session: transactionalSession || undefined, }) ) From 4bc4b60949b907a89522a13c592508610a27000e Mon Sep 17 00:00:00 2001 From: Antoine Cormouls Date: Thu, 14 Oct 2021 17:05:25 +0200 Subject: [PATCH 2/4] docs: move changelog --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2254866736..f30a6dc818 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -105,7 +105,7 @@ ___ ## Features - (none) ## Bug Fixes - - (none) + - refactor: Mongo deprecation warnings on database connect and returnOriginal (Moumouls) [#7626](https://github.com/parse-community/parse-server/pull/7626) # [5.0.0-alpha.1](https://github.com/parse-community/parse-server/compare/4.10.4...5.0.0-alpha.1) (2021-10-12) @@ -174,7 +174,6 @@ ___ - refactor: deprecate `Parse.Cloud.httpRequest`; it is recommended to use a HTTP library instead. (Daniel Blyth) [#7595](https://github.com/parse-community/parse-server/pull/7595) - refactor: Modernize HTTPRequest tests (brandongregoryscott) [#7604](https://github.com/parse-community/parse-server/pull/7604) - Allow liveQuery on Session class (Daniel Blyth) [#7554](https://github.com/parse-community/parse-server/pull/7554) -- Fix Mongo deprecation warnings on database connect and returnOriginal (Moumouls) [#7626](https://github.com/parse-community/parse-server/pull/7626) # 4.10.4 [Full Changelog](https://github.com/parse-community/parse-server/compare/4.10.3...4.10.4) From b2c4b8ff4482e47a2634b8d552ca0aabe85f9cad Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Sun, 17 Oct 2021 20:25:34 +0200 Subject: [PATCH 3/4] remove refactor changelog entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f30a6dc818..c876810e6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -105,7 +105,7 @@ ___ ## Features - (none) ## Bug Fixes - - refactor: Mongo deprecation warnings on database connect and returnOriginal (Moumouls) [#7626](https://github.com/parse-community/parse-server/pull/7626) + - (none) # [5.0.0-alpha.1](https://github.com/parse-community/parse-server/compare/4.10.4...5.0.0-alpha.1) (2021-10-12) From 11f448d56bb6e4ee24f479811f39633c9d8e7cdd Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Sun, 17 Oct 2021 20:27:23 +0200 Subject: [PATCH 4/4] Delete .prettierignore --- .prettierignore | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 2e1fa2d52e..0000000000 --- a/.prettierignore +++ /dev/null @@ -1 +0,0 @@ -*.md \ No newline at end of file