7fife-backend/node_modules/mongoose/lib/helpers/indexes/applySchemaCollation.js

14 lines
357 B
JavaScript
Raw Normal View History

2024-03-07 13:01:44 +00:00
'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;
}
};