diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2017-02-15 11:47:54 -0500 |
---|---|---|
committer | Tess Avitabile <tess.avitabile@mongodb.com> | 2017-02-16 09:33:13 -0500 |
commit | 89d37b751cb9404a81a33f4effc5c4657a17b359 (patch) | |
tree | 5338cfaf4993157f4bb0fcd5cf6c416c758b114a /jstests/core/collation.js | |
parent | 38c0eb538d0fd390c6cb9ce9ae9894153f6e8ef5 (diff) | |
download | mongo-89d37b751cb9404a81a33f4effc5c4657a17b359.tar.gz |
SERVER-28017 ne should respect the collection default collation
Diffstat (limited to 'jstests/core/collation.js')
-rw-r--r-- | jstests/core/collation.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/jstests/core/collation.js b/jstests/core/collation.js index 6c176d3054b..51bec0f8bce 100644 --- a/jstests/core/collation.js +++ b/jstests/core/collation.js @@ -590,6 +590,8 @@ assert.eq(0, coll.find({str: "FOO"}).itcount()); assert.eq(0, coll.find({str: "FOO"}).collation({locale: "en_US"}).itcount()); assert.eq(1, coll.find({str: "FOO"}).collation({locale: "en_US", strength: 2}).itcount()); + assert.eq( + 1, coll.find({str: {$ne: "FOO"}}).collation({locale: "en_US", strength: 2}).itcount()); // Find should return correct results when collation specified and compatible index exists. assert.commandWorked( @@ -601,6 +603,11 @@ .collation({locale: "en_US", strength: 2}) .hint({str: 1}) .itcount()); + assert.eq(1, + coll.find({str: {$ne: "FOO"}}) + .collation({locale: "en_US", strength: 2}) + .hint({str: 1}) + .itcount()); assert.commandWorked(coll.dropIndexes()); // Find should return correct results when collation specified and compatible partial index @@ -647,6 +654,7 @@ assert.writeOK(coll.insert({str: "bar"})); assert.eq(3, coll.find({str: {$in: ["foo", "bar"]}}).itcount()); assert.eq(2, coll.find({str: "foo"}).itcount()); + assert.eq(1, coll.find({str: {$ne: "foo"}}).itcount()); assert.eq([{str: "bar"}, {str: "foo"}, {str: "FOO"}], coll.find({}, {_id: 0, str: 1}).sort({str: 1}).toArray()); |