Search code examples
javagoogle-app-enginecase-insensitiveobjectify

Case insensitive filter query with Objectify + google appengine


Is there an easy way to do a case insensitive filter query with Objectify + google appengine (Java)? Essentially this is what I am trying to do except that I need the filter on email to be case insensitive.

Objectify objectifyService = ObjectifyService.begin();
objectifyService.query(AppUser.class).filter("email", email).get();

Solution

  • You need to store your email address in a normalized (lowercase or uppercase, for instance) form in the datastore, and query on that. If you also need the original unmodified email address, you should store both separately.