Support $regex being defined by string/options
megawac opened this issue · comments
Graeme Yeates commented
I'm planning to use $regex to filter a collection on a client and a server. For ease of use transfer (JSON encoding) I wanted to use the <field>: {$regex: '<str>', $options: '<flags>}
format described here [1]. Underscore-query should construct the regexp in these cases.
[1] https://docs.mongodb.com/manual/reference/operator/query/regex/
Dave Tonge commented
@megawac here is the functionality in query-predicate
: davidgtonge/query-predicate@1f0cb86
The code is extreme point-free, but I like the separation of the parser and the query runner.