[SERVER-43222] Collation options on collections or indices ignored during find Created: 08/Sep/19  Updated: 11/Sep/19  Resolved: 11/Sep/19

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

Type: Bug Priority: Major - P3
Reporter: Marshall Giguere Assignee: Danny Hatcher (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Steps To Reproduce:

db.createCollection('collationTest', { collation: { 'locale' : 'en_US_POSIX', 'caseLevel' : false, 'strength' : 1}});
db.collationTest.insert( { 'last' : 'Smith', 'first' : 'Snuffy' } );
db.collationTest.insert( { 'last' : 'Smith', 'first' : 'John' } );
db.collationTest.insert( { 'last' : 'Luggenut', 'first' : 'Otto' } );
 
> db.collationTest.find( { 'last' : 'smith' } );
null
 
db.collationTest.find( { 'last' : 'Smith' } );
{ "_id" : ObjectId("5d74618dd913165407782183"), "last" : "Smith", "first" : "Snuffy" }
{ "_id" : ObjectId("5d74da59d913165407782185"), "last" : "Smith", "first" : "John" }

Participants:

 Description   

Collections created after upgrade from mongo server 4.0 to 4.2 ignore collation options when querying same for indexing.



 Comments   
Comment by Danny Hatcher (Inactive) [ 11/Sep/19 ]

The SERVER project is for bugs and feature suggestions for the MongoDB server. If you need assistance troubleshooting, I encourage you to ask our community by posting on the mongodb-user group or on Stack Overflow with the mongodb tag.

Comment by Marshall Giguere [ 09/Sep/19 ]

Daniel; Is there some method to dump a collections attributes so I can see the collation, and other things about the collection?

Thanks

Comment by Marshall Giguere [ 09/Sep/19 ]

Yes, I indicated the wrong collation locale, sorry. After some deeper investigation it appears that the IDE I'm using has a bug and is not creating collections as specified. I'm passing that information on to the developers. This was very tricky to track down.

Comment by Danny Hatcher (Inactive) [ 09/Sep/19 ]

I believe this is because you are using the "en_US_POSIX" locale instead of "en_US". If you use "en_US" on 4.2.0, does the case-insensitive search work?

Comment by Marshall Giguere [ 08/Sep/19 ]

Forgot to include info.

Platforms: Ubuntu 18.04, Windows 10
Deb package: mongodb-org-server, 4.2.0

Generated at Thu Feb 08 05:02:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.