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') {
61
61
databaseAdapter = new MongoStorageAdapter ( {
62
62
uri : mongoURI ,
63
63
collectionPrefix : 'test_' ,
64
+ mongoOptions : {
65
+ enableSchemaHooks : true ,
66
+ }
64
67
} ) ;
65
68
}
66
69
Original file line number Diff line number Diff line change @@ -104,7 +104,10 @@ export function getFilesController(options: ParseServerOptions): FilesController
104
104
throw 'When using an explicit database adapter, you must also use an explicit filesAdapter.' ;
105
105
}
106
106
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 ) ;
108
111
} ) ;
109
112
return new FilesController ( filesControllerAdapter , appId , {
110
113
preserveFileName,
You can’t perform that action at this time.
0 commit comments