feat: Disable index-field validation to create index for fields that don't yet exist (#8137)

This commit is contained in:
Antoine Cormouls
2025-10-10 00:03:52 +02:00
committed by GitHub
parent f024d532f0
commit 1b2347524c
5 changed files with 69 additions and 21 deletions

View File

@@ -37,7 +37,7 @@ export class GridFSBucketAdapter extends FilesAdapter {
const defaultMongoOptions = {
};
const _mongoOptions = Object.assign(defaultMongoOptions, mongoOptions);
for (const key of ['enableSchemaHooks', 'schemaCacheTtl', 'maxTimeMS']) {
for (const key of ['enableSchemaHooks', 'schemaCacheTtl', 'maxTimeMS', 'disableIndexFieldValidation']) {
delete _mongoOptions[key];
}
this._mongoOptions = _mongoOptions;