tigris
tigris copied to clipboard
Support filter's dot notation for arrays
Is your feature request related to a problem? Please describe.
To support more user queries, we need the ability to use "dot notation" in the filter when searching for values in arrays.
Examples:
-
foo.0.bar.1
- to address the exact array value with the given indexes -
foo.bar
- to address any array element infoo.*.bar.*
arrays
Usage example:
filter = `{"foo.0.bar.1": "hello"}` // the exact array element is "hello"
filter = `{"foo.bar": "hello"}` // any element of `foo.*.bar.*` array is "hello"
Additional context
To support more query pushdown cases in FerretDB.
@garrensmith let's think about this use case as well for filtering on array fields.
Nice. This should be possible with the secondary indexes. We have to change the keybuilder and filter to support nested queries. The part I'm uncertain around is the foo.Position1.bar.Position2
I think that part would have to be done in memory.
Add support for lambda style filtering. There are two examples we can refer to:
duckdb nested functions: https://duckdb.org/docs/sql/functions/nested - list_filter jsonpath - https://goessner.net/articles/JsonPath/