suddenly there is an idea that if the field changes are complicated when making a query, you can"t write the query statement, just like
A.query.filter (name=="ds") is written dead. If I need to dynamically switch query fields, especially when there are multiple fields, the idea is to have a function as the query condition, so I can control the output of the function, similar to A.query.filter (fun ()) when fun returns" age==18",
if I need to look up name, or more fields, just change the output of func.
I know that you can"t give a function directly, but usually write a query statement, so that the query is fixed and inflexible.
I wonder if my idea can be implemented (one way is to use eveal () to wrap the entire query, and then modify the filter Filter parameters), is there a better way to implement it?