File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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,
You can’t perform that action at this time.
0 commit comments