Skip to content

Commit

Permalink
test: repro #9224
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jul 10, 2020
1 parent f71eaff commit 9ec30b8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/helpers/indexes.isIndexEqual.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,25 @@ describe('isIndexEqual', function() {
dbIndex.collation.locale = 'de';
assert.ok(!isIndexEqual(key, options, dbIndex));
});

it('works when MongoDB index has collation but Mongoose index doesn\'t (gh-9224)', function() {
const key = { username: 1 };
const options = {};
const dbIndex = {
unique: true,
key: { username: 1 },
name: 'username_1',
background: true,
collation: {
locale: 'en',
caseLevel: false,
caseFirst: 'off',
strength: 2,
numericOrdering: false,
version: '57.1'
}
};

assert.ok(!isIndexEqual(key, options, dbIndex));
});
});

0 comments on commit 9ec30b8

Please sign in to comment.