I’m doing a string query and want to match results regardless of how letters are formatted (lowercase, uppercase, capitalized).
Is there any way I can convert the database results to lowercase?
I’m converting the initial search term to lowercase first.
const searchTerm = s?.toString()?.toLowerCase();
const Profiles = Moralis.Object.extend('Profiles');
const query = new Moralis.Query(Profiles);
query.select('name', 'logo', 'ethAddress');
query.startsWith('name', searchTerm);
query.limit(5);
const results = await query.find();
return res.status(200).json(results);
Example: a name in the database could be ABC. I’d like to find all results whether it’s spelled ‘abc’, ‘ABC’, ‘AbC’, ‘Abc’, etc.