palicao / phpRedisTimeSeries

📈 Use Redis Time Series in PHP!
MIT License
28 stars 13 forks source link

Support for TS.RANGE's FILTER_BY_VALUE and FILTER_BY_TS parameters #30

Open smcgovern opened 1 year ago

smcgovern commented 1 year ago

Hello,

Awesome library, thanks for the work put into it. I noticed in Redis' TimeSeries documentation on TS.RANGE (https://redis.io/commands/ts.range) there is a parameter to filter results by their value FILTER_BY_VALUE. Am I mistaken in saying the current version of this package doesn't support that within its range function? https://github.com/palicao/phpRedisTimeSeries/blob/master/src/TimeSeries.php#L303

Is there a way for me to execute this, or add additional raw parameters to the end of a command?

Thanks again!

Edit: Ah yes I now see this package is last tested against TimeSeries 1.4, and these things were added in 1.6, I'm going to review how you set this package up and try to follow best practice for adding these features, but it be great if this and LATEST, which was added in 1.8, could be implemented.

smcgovern commented 1 year ago

Not sure if this is best, but I implemented https://github.com/palicao/phpRedisTimeSeries/commit/2f2a1f9630075cf0797d92c4f55642a17bc1ff3f on my fork to get this working in my projects. I'm sure theres other pieces to this that are worth adding that I'll encounter while digesting the redis docs, but for now this is what I've needed.