-
Notifications
You must be signed in to change notification settings - Fork 46
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
Create Query via JSON #33
Comments
There's no support for this yet. Shouldn't be too hard to add though. |
i would really like to be able to do this. For me, the intent is to allow others to write queries without recompiling. |
Yeah the types would have to be in code. The way I'm picturing this is a Function call QueryFromJSON or something, and you'd pass in something like this: {
"field": "Name",
"op": "eq",
"value": "John",
"and": {
"field": "ID",
"op": "ge",
"value": 3
},
"or": {
"field": "Death",
"op": "lt",
"value": {
"field": "Birth",
}
}
} |
hey @timshannon. That looks like a good start. Just as a side thought, I was wondering if its possible to write a query in golang and then just deserialize it out as JSON ? This would mean that you could gen the json as part of the build and then run the JSON as tests. Its also means that when you add new query predicates of your own the system is self adapting. If this is not possible its fine, but it was more of an idea. Edit: This reminds me a lot of Bleve and the JSON based blast. |
@timshannon found this the queries as serialisable :) |
I just started playing with
bolthold
this evening and it was quick and easy to setup. Really digging it so far.Maybe this is already supported, but is there any way to construct a *Query via JSON? I would make for a nice search capability on a REST endpoint I'm considering. Since it would allow a query via json to be passed and evaluated.
I could come up with my own mechanism but would take some work to map into the fluent aspects of the current Query with the hidden internals.
The text was updated successfully, but these errors were encountered: