Skip to content

Commit bc51681

Browse files
authored
Merge bf1c93b into 0bb63d8
2 parents 0bb63d8 + bf1c93b commit bc51681

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

spec/helper.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ if (process.env.PARSE_SERVER_TEST_DB === 'postgres') {
6161
databaseAdapter = new MongoStorageAdapter({
6262
uri: mongoURI,
6363
collectionPrefix: 'test_',
64+
mongoOptions: {
65+
enableSchemaHooks: true,
66+
}
6467
});
6568
}
6669

src/Controllers/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ export function getFilesController(options: ParseServerOptions): FilesController
104104
throw 'When using an explicit database adapter, you must also use an explicit filesAdapter.';
105105
}
106106
const filesControllerAdapter = loadAdapter(filesAdapter, () => {
107-
return new GridFSBucketAdapter(databaseURI, databaseOptions, fileKey);
107+
const newDatabaseOptions = { ...databaseOptions };
108+
// enableSchemaHooks is not a valid mongodb option
109+
delete newDatabaseOptions.enableSchemaHooks;
110+
return new GridFSBucketAdapter(databaseURI, newDatabaseOptions, fileKey);
108111
});
109112
return new FilesController(filesControllerAdapter, appId, {
110113
preserveFileName,

0 commit comments

Comments
 (0)