←back to thread

71 points genshii | 2 comments | | HN request time: 0.44s | source

Hey all, I just released v2.0.0 of FilterQL, a query language and TypeScript library. This version adds support for Operations, which allow you to transform the data after filtering.

If you think this would be useful in a project you're working on, give it a try and let me know what you think!

1. olivergregory ◴[] No.45037865[source]
It seems nice. However is there any way to query arrays within the datastructure itself? Or go deeper in the hierarchy, such as "model.cost"?
replies(1): >>45040756 #
2. genshii ◴[] No.45040756[source]
I thought about doing exactly what you suggested, where a query could access deeper properties with a syntax like "model.cost", but ultimately decided against it because I didn't like the complexity that would necessitate.

As for arrays, I usually opt for joining the string and then doing an "includes" query. e.g. ["sm", "md", "lg"] -> "sm,md,lg" and then you could write a query like "size *= md". Obviously this approach has its disadvantages though.

I'm definitely open to rethinking both of these if that's a common enough want/need.