Info
Collections created after upgrade from mongo server 4.0 to 4.2 ignore collation options when querying same for indexing.
Top User Comments
daniel.hatcher commented on Wed, 11 Sep 2019 20:20:25 +0000:
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.
marsh.giguere@gmail.com commented on Mon, 9 Sep 2019 16:21:07 +0000:
Daniel; Is there some method to dump a collections attributes so I can see the collation, and other things about the collection?
Thanks
marsh.giguere@gmail.com commented on Mon, 9 Sep 2019 16:13:51 +0000:
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.
daniel.hatcher commented on Mon, 9 Sep 2019 15:15:50 +0000:
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?
marsh.giguere@gmail.com commented on Sun, 8 Sep 2019 12:55:51 +0000:
Forgot to include info.
Platforms: Ubuntu 18.04, Windows 10
Deb package: mongodb-org-server, 4.2.0
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" }