Learning to use CFWheels, I find this framework's ORM supports findOne method for getting a single record and findAll method for getting one ore more records that match the criteria you provide. There are other variations of that (findbyKey, etc.) but I'm not finding any mention of query of queries support without making my own custom function to do that.
Does anyone out there using CFWheels know of native support for QoQ (query of queries) in a way that allows using findAll() to get a full set of records and then run that thru a QoQ to narrow it down to one or a few records over and over for use on a view page (template)? It seems very inefficient to have to call a findAll(where='category="A"'), then findAll(where='category="B"'), etc. Since CF does QoQ in memory, it is much faster and doesn't hit the db over and over.
Edit: After having read through your question some more time, I guess you could try something like this:
Note: array.filter() is cfml and not cfwheels specific: https://docs.lucee.org/reference/objects/array/filter.html
I don't know cfwheels at all, but according to the docs you could:
Run
findAll()with thereturnAsargument set toquery, save the query into a variable and then do one or multiple QoQ on that variable. That could look smtg like this:Keep in mind, that on large datasets multiple requests to the database server would probably be more efficient, if the database server is in the same network.
Hope it helped a bit.