In the Mongo shell this works correctly to create a case-insensitive search of a database for which I have created a case-insensitive index:
use dt3_api
db["LCP Production"].find({dt_name:"kaplan"}).collation({locale: 'en_US', strength: 1})
I am trying to do the same thing as a Realm function as follows:
exports= function (payload) {
// const query={"dt_name":(payload.query.testparam)};
const mongodb=context.services.get("mongodb-atlas");
const mycollection = mongodb.db("dt3_api").collection("LCP Production");
return mycollection.find({dt_name:"kaplan"}).collation({locale: 'en_US', strength: 1})
};
But when I run this I get this error:
I am using Mongo 4.4.8 so I believe the collation function should work (as indeed it works in the shell).
Is there some alternate way to run a search on a collated index as a Realm function?