Use `matchesGlob` in UI component/fetch call


#1

Is there a UI component that supports wildcard searching within a UIViewFilterForm component, i.e. supports the matchesGlob ExpressionEngineFunction method?

Also, how should this be used in the context of a fetch call? I tried:

c3Grid(MyType.fetch({
    filter: "matchesGlob(id, 'BEG*END')"
}))

and wound up with an ActionError - I’m not sure if this is supported for fetch calls


#2

I’m not sure matchesGlob is supported at this time… but you could write an in-between function that translates the wildcard to an equivalent regex, then use matchesRegex


#3

@scott.kruyswyk There is no Postgres db support for matches glob and thus, we don’t support it as a filter.


#4

@trothwein in general, is there a way to know which expression engine functions will work in which context (filter vs projection vs metric vs stored calc vs include)?


#5

@Riley Sorry I missed this. At present, there isn’t anything that gives you that. What I suggest is that the assumption is that they “all” are supported. As we become aware (perhaps with an initial review), we either add the missing support or mark that it is not supported in filtering.