NarrativeFlow / static /node_modules /mongoose /lib /helpers /indexes /applySchemaCollation.js
kaab4321's picture
first
9756872
Raw History Blame Contribute Delete
357 Bytes
'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;
}
};