applySchemaCollation.js 357 B

12345678910111213
  1. 'use strict';
  2. const isTextIndex = require('./isTextIndex');
  3. module.exports = function applySchemaCollation(indexKeys, indexOptions, schemaOptions) {
  4. if (isTextIndex(indexKeys)) {
  5. return;
  6. }
  7. if (schemaOptions.hasOwnProperty('collation') && !indexOptions.hasOwnProperty('collation')) {
  8. indexOptions.collation = schemaOptions.collation;
  9. }
  10. };