Filtering on an empty array
Chris Hiester
Let's say I want to filter on an array if IDs. If my array has one ID in it, I get one record back. If my array has 10 IDS, I get 10 records back. But currently, if my array has zero IDs in it, I get every record in the database back. I can understand from a general programming perspective why this is so--if your filter is empty, nothing gets filtered. But in this case, it makes more sense to me that, since my array has zero IDs--and the intent was to return only the IDs in my array, if I didn't supply any IDs, I should not get any records back. This has tripped me up a few times and I have had to awkwardly work around it by using a conditional such that if the array is empty, I don't do the xata operation at all and just return my own empty array.