Files
diploma_todoapp/backend/node_modules/mongoose/lib/helpers/indexes/applySchemaCollation.js
2026-04-02 17:50:10 +08:00

14 lines
357 B
JavaScript

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