From c78a9c675d3264e987a91af8b5043deb0b683be9 Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Tue, 13 Sep 2022 16:16:55 -0500 Subject: [PATCH] Run test suite against enableSchemaHooks --- spec/helper.js | 3 +++ src/Controllers/index.js | 1 + 2 files changed, 4 insertions(+) diff --git a/spec/helper.js b/spec/helper.js index f769c0f521..699868c966 100644 --- a/spec/helper.js +++ b/spec/helper.js @@ -61,6 +61,9 @@ if (process.env.PARSE_SERVER_TEST_DB === 'postgres') { databaseAdapter = new MongoStorageAdapter({ uri: mongoURI, collectionPrefix: 'test_', + mongoOptions: { + enableSchemaHooks: true, + }, }); } diff --git a/src/Controllers/index.js b/src/Controllers/index.js index 0a9b3db57d..9c76970b33 100644 --- a/src/Controllers/index.js +++ b/src/Controllers/index.js @@ -104,6 +104,7 @@ export function getFilesController(options: ParseServerOptions): FilesController throw 'When using an explicit database adapter, you must also use an explicit filesAdapter.'; } const filesControllerAdapter = loadAdapter(filesAdapter, () => { + delete databaseOptions.enableSchemaHooks; return new GridFSBucketAdapter(databaseURI, databaseOptions, fileKey); }); return new FilesController(filesControllerAdapter, appId, {