mirror of
https://github.com/JonasunderscoreJones/jonas_jones-api.git
synced 2025-10-24 01:29:19 +02:00
13 lines
357 B
JavaScript
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;
|
|
}
|
|
};
|