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, {