fix: GridFSBucketAdapter throws when using some Parse Server specific options in MongoDB database options (#9915)

This commit is contained in:
Manuel
2025-11-08 18:41:45 +01:00
committed by GitHub
parent 502a512028
commit d3d4003570
5 changed files with 53 additions and 28 deletions

View File

@@ -24,10 +24,20 @@ describe_only_db('mongo')('GridFSBucket', () => {
const databaseURI = 'mongodb://localhost:27017/parse';
const gfsAdapter = new GridFSBucketAdapter(databaseURI, {
retryWrites: true,
// these are not supported by the mongo client
// Parse Server-specific options that should be filtered out before passing to MongoDB client
allowPublicExplain: true,
enableSchemaHooks: true,
schemaCacheTtl: 5000,
maxTimeMS: 30000,
disableIndexFieldValidation: true,
logClientEvents: [{ name: 'commandStarted' }],
createIndexUserUsername: true,
createIndexUserUsernameCaseInsensitive: true,
createIndexUserEmail: true,
createIndexUserEmailCaseInsensitive: true,
createIndexUserEmailVerifyToken: true,
createIndexUserPasswordResetToken: true,
createIndexRoleName: true,
});
const db = await gfsAdapter._connect();