I'm trying to create case sensitive index with mongoDB version 3.4? I'm using the following query to create an index but still it allows me to insert data with different case?
db.Test.createIndex( { "type" : 1 },{ unique: true , collation: { locale: 'en' ,caseLevel:true ,strength: 3 } } )
in the above query i'm making Type as unique. First i inserted "apple" into the database and when i try to "apple" it throws duplicate error. but when i try to insert "Apple" it allows me to insert. for me while inserting "Apple" it should throws duplicate error.