Skip to content

Commit 4e74ea7

Browse files
committedMar 24, 2021
TIL that includes() is also not supported in all browsers
1 parent f231d7b commit 4e74ea7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎lib/model.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1637,10 +1637,10 @@ function _ensureIndexes(model, options, callback) {
16371637
const results = Object.keys(indexFields).map(function(key) {
16381638
return indexFields[key];
16391639
});
1640-
if (!results.includes('text')) {
1641-
return true;
1640+
if (results.indexOf('text') !== -1) {
1641+
return false;
16421642
}
1643-
return false;
1643+
return true;
16441644
};
16451645
delete indexOptions._autoIndex;
16461646
_decorateDiscriminatorIndexOptions(model, indexOptions);

0 commit comments

Comments
 (0)
Please sign in to comment.