Skip to content
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

how to filter for some scope with Query.filter shortcut methods? #58

Open
siemionides opened this issue Oct 8, 2014 · 2 comments
Open

Comments

@siemionides
Copy link
Contributor

I would like to filter out for the objects that have , let's say value attribute.
How to perform "lower than A" AND "greater than B" query?
Using query = Diametric::Query.new(Badge, nil, true).filter(:>, :value, 15).filter(:<, :value, 40) won't work, as the query.data.inspect returns

[[:find, #<EDN::Type::Symbol:0x5d27af65 @symbol=:"?e">, :in, #<EDN::Type::Symbol:0x586c3faa @symbol=:"$">, [#<EDN::Type::Symbol:0x2811f8b1 @symbol=:"?valuevalue">, #<EDN::Type::Symbol:0x33de4104 @symbol=:"?valuevalue">], :where, [#<EDN::Type::Symbol:0x4f20b45b @symbol=:"?e">, :"badge/value", #<EDN::Type::Symbol:0x6c20eaf2 @symbol=:"?value">], [(> ?value ?valuevalue)], [(< ?value ?valuevalue)]], [15, 40]]

so in the end both the lower/greater than signs are applied to the same ?valuevalue.
Is there any way I can enforce diametric to take 2 additional arguments (apart from writing a custom query in the string?)

Regards,
Michal

@yokolet
Copy link
Contributor

yokolet commented Oct 8, 2014

Hi Michal,

It looks filter method is broken now. I'll have a look and update the gem. Sorry for the bugs.

@siemionides
Copy link
Contributor Author

no problem, glad to report them & help in some way ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants