We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Openning this as an issue from our slack conversation.
I’m trying to filter for messages that have content longer than 200 characters: [?u :message/content ?content] [(> (count ?content) 200)] :find (count ?content).] @*conn*) => nil Doesn’t return anything. Why? I’m assuming you can’t nest functions? Separating out the functions still doesn’t return anything either though: [?u :message/content ?content] [(count ?content) ?n] [(> ?n 200)] :find (count ?content).] @*conn*) => nil If I implement my own greater than function this works: (> a b)) (d/q '[:where [?u :message/content ?content] [(count ?content) ?n] [(app.scratch/my2> ?n 200)] :find (count ?content).] @*conn*) => 5 Is this because > is special for range queries? Anders
I’m trying to filter for messages that have content longer than 200 characters:
[?u :message/content ?content] [(> (count ?content) 200)] :find (count ?content).] @*conn*) => nil
Doesn’t return anything. Why? I’m assuming you can’t nest functions?
Separating out the functions still doesn’t return anything either though:
[?u :message/content ?content] [(count ?content) ?n] [(> ?n 200)] :find (count ?content).] @*conn*) => nil
If I implement my own greater than function this works:
(> a b)) (d/q '[:where [?u :message/content ?content] [(count ?content) ?n] [(app.scratch/my2> ?n 200)] :find (count ?content).] @*conn*) => 5
Is this because > is special for range queries?
>
the current built-in > does not resolve its arguments. Remember, we cannot call eval, so we need to walk the arguments to > resolve them. Huahai
the current built-in > does not resolve its arguments. Remember, we cannot call eval, so we need to walk the arguments to > resolve them.
My take away from the conversation is the below should work, but nesting functions can't (as it gets messy with eval).
(d/q '[:where [?u :message/content ?content] [(count ?content) ?n] [(> ?n 200)] :find (count ?content).] @*conn*) => nil
I'm going to have a look into this and see if I can create a PR.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Openning this as an issue from our slack conversation.
My take away from the conversation is the below should work, but nesting functions can't (as it gets messy with eval).
I'm going to have a look into this and see if I can create a PR.
The text was updated successfully, but these errors were encountered: