Start a new topic

Case-insensitive Query

I have followed this guide on querying datastore: but it seems that the query is case-sensitive.

How do I make a case-insensitive query?

The `Query` class has a `regex(String field, String regex)` method which you can use for this by defining a case-insensitive regex.

Something like:

Query myQuery = new Query().regex("myJSONKey", myRegex);

Here is the documentation:, java.lang.Object)
Thank you Edward.

I'm new at this so I hadn't used regex before. So I beleive "myRegex" would be something like:


Correct?, java.lang.Object)

explicitly says

> A regex must begin with a carat `^`, **and case-insensitive queries `/i` are not supported.**

So not supported then?
Hey, yeah, do to the performance implications of supporting case-insensitive queries we had to disable the feature.

I will update the javadocs to remove that.
Login or Signup to post a comment