Hi,
I’m new to queries and especially advanced queries. I’m trying to create a query that fetches all block that
- has an “item-type” property with value “X”
- AND has a “source” property that starts with “Y”
- AND doesn’t have a property named “template”
I have created the query below by copy/pasting stuff from all over the documentation and the support forum, but I get the error "Missing rules var '%' in :in"
. Would appreciate some help with it. I didn’t include the third criteria in the below snippet since I’m stuck at the second step. But, please include that in your response if you can.
#+BEGIN_QUERY
{
:title "I'm stuck"
:query [
:find (pull ?b [*])
:where
[?b :block/properties ?props]
[(get ?props :item-type) ?it]
[(get ?props :source) ?source]
[(str ?source) ?str-source]
(and
[(= ?it #{"X"})]
[(clojure.string/starts-with? ?str-source "Y")]
)
]
}
#+END_QUERY