-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wildcard search in ?all #29
Comments
Interesting idea, I like it! Instead of just going for starting-with filtering, this essentially adds support for all sorts of complex filters. What about going for slashes as a delimiter of choice? I wonder if other databases support this... |
Yes, exactly. As far as the support from other db adapters, yes they most certainly do, it's just that they would need to do a The delimiter should be irrelevant because it's just a string key. I like the dot but it really doesn't matter for any implementation that I think is planned. |
I like it, let's do it. Could you submit a PR against the flat-file-db adapter implementing this, and a PR against this repo verifying it works as expected under all circumstances and adding documentation for it in the How do we handle users doing e.g. this |
I think it would save |
And yes, I will create a set of prs |
The issue with saving |
Sure, I don't think that would be a bad option. Do you think that's a v1 thing to add or a wait until people actually have the need? |
We definitely need to do this before adapters get big and we have 50 of them without this feature 😉 |
So, trying to mimic some really expressive behavior that grafana uses. They allow you to track metrics with keys like:
a.b.c.d.e
and you can do analytics/querying based on searches ofa.b.*.d.e
. Note, using dots instead of slashes wouldn't change how this is implemented.A real world scenario around this:
myapp.*.logins
where the convention used is
myapp.version.logins
.That query (
services.com/myapp.*.logins?all=true
) allows you to get all login event metrics across all versions/deploys and can compare. A/B testing and a lot of things would be enabled by this.I'd imagine we would just pass the raw string to the db adaptor and let them figure out how to parse/support it. For the file-db adaptor, should be a simple change of the filter to use a regex. Something along the lines of
key.match(new RegExp('^' + options.pathname.replace('*','.*')))
The text was updated successfully, but these errors were encountered: