How to make case-insensitive search query using Flask-Restless?
Example:
api/user?q={"filters":[{"name":"lastname","op":"like","val":"%davidson%"}]}
I would like the previous code to return "davidson", "Davidson", "DAVIDSON"... But it only returns "davidson".
You can use the
ilikeoperator like so:This is not really documented in the Flask-Restless docs, but the operator is documented in SQLAlchemy which is the OR mapper Flask-Restless uses under the hood. See the relevant docs here or this answer.