diff --git a/lib/model.js b/lib/model.js index 7edbce6ce28..b50ea3b09c3 100644 --- a/lib/model.js +++ b/lib/model.js @@ -3688,7 +3688,7 @@ Model.castObject = function castObject(obj, options) { } if (schemaType.$isMongooseDocumentArray) { - const castNonArraysOption = schemaType.options?.castNonArrays ??schemaType.constructor.options.castNonArrays; + const castNonArraysOption = schemaType.options?.castNonArrays ?? schemaType.constructor.options.castNonArrays; if (!Array.isArray(val)) { if (!castNonArraysOption) { if (!options.ignoreCastErrors) { diff --git a/types/indexes.d.ts b/types/indexes.d.ts index bfb1bd1cbb1..884e41cae92 100644 --- a/types/indexes.d.ts +++ b/types/indexes.d.ts @@ -10,7 +10,7 @@ declare module 'mongoose' { function syncIndexes(options?: SyncIndexesOptions): Promise; interface IndexManager { - /* Deletes all indexes that aren't defined in this model's schema. Used by `syncIndexes()`. */ + /* Deletes all indexes that aren't defined in this model's schema. Used by `syncIndexes()`. Returns list of dropped index names. */ cleanIndexes(options?: { toDrop?: string[], hideIndexes?: boolean }): Promise; /**