[SERVER-28017] $ne perform a case sensitive find when it should do a case insensitive find based on collation settings Created: 15/Feb/17  Updated: 05/Apr/17  Resolved: 16/Feb/17

Status: Closed
Project: Core Server
Component/s: Index Maintenance, Querying
Affects Version/s: 3.4.2
Fix Version/s: 3.4.3, 3.5.4

Type: Bug Priority: Major - P3
Reporter: daniel moqvist Assignee: Tess Avitabile (Inactive)
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.4
Steps To Reproduce:

use admin
db.runReadCommand({ setFeatureCompatibilityVersion:"3.4"})
use testdb
db.createCollection("testcollection",{collation:{locale: "sv", strength:1, numericOrdering:true}})
db.testcollection.insert( { data: "test" } )
db.testcollection.insert( { data: "TEST" } )
 
> db.testcollection.find({ data: { $eq: "test" } })
{ "_id" : ObjectId("58a461e0aa464d5347f68ecb"), "data" : "test" }
{ "_id" : ObjectId("58a461f0aa464d5347f68ecc"), "data" : "TEST" }
 
> db.testcollection.find({ data: { $ne: "test" } })
{ "_id" : ObjectId("58a461f0aa464d5347f68ecc"), "data" : "TEST" }
>//the above query should not result in any document but it returns the one with uppercase.

Sprint: Query 2017-03-06
Participants:

 Description   

Using the following collation settings on collection collation:

{locale: "sv", strength:1, numericOrdering:true}

makes $eq searches case insensitive.
But when the filter is $ne it is not case insensitive.



 Comments   
Comment by Githook User [ 17/Feb/17 ]

Author:

{u'username': u'tessavitabile', u'name': u'Tess Avitabile', u'email': u'tess.avitabile@mongodb.com'}

Message: SERVER-28017 ne should respect the collection default collation
Branch: v3.4
https://github.com/mongodb/mongo/commit/131e03e5dc4fa94d44f600d2844b470ede4f1d4e

Comment by Githook User [ 16/Feb/17 ]

Author:

{u'username': u'tessavitabile', u'name': u'Tess Avitabile', u'email': u'tess.avitabile@mongodb.com'}

Message: SERVER-28017 ne should respect the collection default collation
Branch: master
https://github.com/mongodb/mongo/commit/89d37b751cb9404a81a33f4effc5c4657a17b359

Comment by Kelsey Schubert [ 15/Feb/17 ]

Hi daniel.moqvist@knowit.se,

Thank you for reporting this issue. We're investigating and will continue to update this ticket.

Kind regards,
Thomas

Generated at Thu Feb 08 04:16:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.