Search code examples
parse-platform

How to search for a substring (WHERE column LIKE '%foo%')


I'm reading parse API documentation at https://parse.com/docs/rest/guide#queries and can't find how to search by a substring. SQL equivalent would be:

... WHERE column_name LIKE "%foo%"

There's a bunch of options such as &gt, &lt, &in, and similar, but there's no option for LIKE. It's pretty common use case... What am I missing?


Solution

  • We've found something that looks like an undocumented feature.

    There's a $regex lookup it's not mentioned in the official API reference. It allows for matching by regular expressions which solved the problem for us.

    We believe it should be documented here:

    https://parse.com/docs/rest/guide/#queries-query-constraints

    But apparently it isn't.