FLUJOS/BACK_BACK/node_modules/mongoose/lib/helpers/indexes/applySchemaCollation.js
2025-11-07 00:06:12 +01:00

13 lines
357 B
JavaScript
Executable file

'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;
}
};