Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support case insensitive queries #102

Open
markrickert opened this issue Jun 16, 2015 · 1 comment
Open

Support case insensitive queries #102

markrickert opened this issue Jun 16, 2015 · 1 comment

Comments

@markrickert
Copy link
Member

The NSPredicate format for doing this is appending [cd] to the end of the condition, for example:

# Would match "Mark" and "mark"
NSPredicate.predicateWithFormat("name CONTAINS[cd] %@", 'ar')

Thoughts on an api for this? Or should we just notate it in the documentation and people can create their own where() statements?

@kemiller
Copy link
Contributor

You can do this with .where(:name).eq("ar", NSCaseInsensitivePredicateOption) which admittedly does not roll right off the tongue. We could make friendlier version with symbols.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants