zkt25/Backend/node_modules/mongoose/lib/helpers/indexes/applySchemaCollation.js
Andrii Pervashov d1b27aff06 initial commit
2025-03-16 16:17:44 +01:00

14 lines
357 B
JavaScript

'use strict';
const isTextIndex = require('./isTextIndex');
module.exports = function applySchemaCollation(indexKeys, indexOptions, schemaOptions) {
if (isTextIndex(indexKeys)) {
return;
}
if (schemaOptions.hasOwnProperty('collation') && !indexOptions.hasOwnProperty('collation')) {
indexOptions.collation = schemaOptions.collation;
}
};