jonas_jones-api/node_modules/mongoose/lib/helpers/indexes/applySchemaCollation.js
2023-03-30 20:40:42 +02:00

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