Logseq DB and advanced queries

Sure, the DB version is not released yet, so my questions can only be a problem of the alpha versions. I’ve downloaded the DB version recently, and now I am not sure how permanent the changes are in regard to advanced queries:

  1. It seems that using properties is no longer available in advanced queries. At least, I could not make the basic example work, which works in the stable version:

{:title [:h2 “Programming languages list”]
:query [:find (pull ?b [*])
:where
(property ?b :prop "value")]}

Also, I don’t see properties in block data with developer tools.

Am I missing something? Maybe now there is another way to build queries with properties? Or would it be better to use new tags instead?

  1. The :view command also seems not to be working in new queries. But actually, I’ve never mastered it, so, again, it can be my skills issue. But I would like to check if it’s just me.

Hi @sorgel
The advanced query still works, but note that some schema changes were introduced.

They are documented in:

Example of Advanced Query:
```clojure
{:query [:find (pull ?b [*])
:where
[?b :user.property/Player-bEMnJKfg ?player]
(or [?player :block/name “player a”]
[?player :block/name “player c”]]
}
```

If you do not see the block data, go to Logseq Settings >> Advanced >> Enable Developer Mode

`:view works, but :result_transform needs a bit of work

1 Like

Thank you so much! I tried not to miss something obvious, but somehow managed to do this.

Maybe that will help someone in future: I can mess something, but it looks like the right way to access the property value is by :block/title, not :block/name.

So in my case this does work:

{:query [:find (pull ?b [*])
:where
[?b :user.property/test-c_eBb5ly ?a]
[?a :block/title “rrr”]
]}

And this does not:

{:query [:find (pull ?b [*])
:where
[?b :user.property/test-c_eBb5ly ?a]
[?a :block/name “rrr”]
]}

Also dev tools suggest using the title instead of the name