Querying pages with property::value but getting no matched result

I have this query and it shows me pages with the property:: value type:: [[project]] :

#+BEGIN_QUERY
{
  :title "Pages with type: [[project]] and status: [[DOING]]"
 :query [:find (pull ?p [*])
          :where
          [?p :block/name]
          [?p :block/properties ?props]
          [(get ?props :type) ?type]
          [(= ?type "[[project]]")]
}
#+END_QUERY

However, when I add these lines of code to the query:

          [(get ?props :status) ?status]
          [(= ?status "[[DOING]]")]]

I get “No results matched” even though I have this page:


What am I doing wrong?

Try either:

  • replacing (= ?status "[[DOING]]") with either:
    • (= ?status #{"DOING"})
    • (contains? ?status "DOING")
      • This is useful with multi-value properties.
  • using :block/properties-text-values :
    [?b :block/properties-text-values ?text-props]
    [(get ?text-props :status) ?text-status]
    [(str "[[DOING]]") ?str-status]
    [(= ?text-status ?str-status)]