Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Realm for React Native - case insensitive search

How do I use the filtered function to make a case insensitive search?

var query = 'david';
var filteredNames = names.filtered('name == $0', query);

This only returns results where name is 'david', not 'David'.

like image 469
David Avatar asked Jul 17 '26 22:07

David


1 Answers

Case insensitive search is supported as of v0.11.0. To search case insensitive you append [c] to your operator eg:

name ==[c] 'jerry'
name BEGINSWITH[c] 'a'
like image 156
Ari Avatar answered Jul 20 '26 10:07

Ari



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!