Hello there,
I have a handy query that get me some blocks of different kind.
{ :title "All stories"
:query [
:find (pull ?b [*])
:where
[?b :block/properties ?prop]
[(get ?prop :kind) ?kind]
[(contains? #{"movie", "show", "anime", "book", "manga", "game"} ?kind)]
]
}
I want to exclude the blocks that are templates.
I know I can use the “missing?” function to achieve that.
What I try to do is to improve my understanding of the language.
{ :title "All stories"
:query [
:find (pull ?b [*])
:where
[?b :block/properties ?prop]
[(get ?prop :kind) ?kind]
[(contains? #{"movie", "show", "anime", "book", "manga", "game"} ?kind)]
[(get ?prop :template) ?template]
[(not (nil? ?template))]
]
}
Why doesn’t this query return anything ?
?template
should be nil
if the key was not present in props, according to the documentation.
It seems that the [(get ?prop :template) ?template]
line filters out blocks without this tag, but I don’t understand why, I just want to affect the ?template
variable.
Thanks for your time.