feat: Add options to skip automatic creation of internal database indexes on server start (#9897)
This commit is contained in:
@@ -154,8 +154,22 @@ export class MongoStorageAdapter implements StorageAdapter {
|
||||
this.enableSchemaHooks = !!mongoOptions.enableSchemaHooks;
|
||||
this.schemaCacheTtl = mongoOptions.schemaCacheTtl;
|
||||
this.disableIndexFieldValidation = !!mongoOptions.disableIndexFieldValidation;
|
||||
for (const key of ['enableSchemaHooks', 'schemaCacheTtl', 'maxTimeMS', 'disableIndexFieldValidation']) {
|
||||
delete mongoOptions[key];
|
||||
// Remove Parse Server-specific options that should not be passed to MongoDB client
|
||||
// Note: We only delete from this._mongoOptions, not from the original mongoOptions object,
|
||||
// because other components (like DatabaseController) need access to these options
|
||||
for (const key of [
|
||||
'enableSchemaHooks',
|
||||
'schemaCacheTtl',
|
||||
'maxTimeMS',
|
||||
'disableIndexFieldValidation',
|
||||
'createIndexUserUsername',
|
||||
'createIndexUserUsernameCaseInsensitive',
|
||||
'createIndexUserEmail',
|
||||
'createIndexUserEmailCaseInsensitive',
|
||||
'createIndexUserEmailVerifyToken',
|
||||
'createIndexUserPasswordResetToken',
|
||||
'createIndexRoleName',
|
||||
]) {
|
||||
delete this._mongoOptions[key];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user