How can i query a child block with a parent tag?

I have the following query:

#+BEGIN_QUERY
{:title [:h1 "Notas:"]
:query [:find (pull ?b [*])
:in $ ?today ?before
:where
	[?b :block/refs ?r] ;; Pull blocks with references
	[?r :block/name "notas"] ;; filter to blocks containing references to "notas"
	[?b :block/page ?p] ;; get pages from ?b that contain the reference "notas" to ?p
	[?p :block/journal-day ?d] ;; get journal pages only
		[(< ?d ?today)] ;; reduce journal pages list to before current day
		[(> ?d ?before)] ;; reduce journal pages list to after 7 days ago
]
:inputs [:today :-7d] ;; input today date and -7 days into :in
:group-by-page? false ;; group results by page
:breadcrumb-show? false ;; show page/block path to block
}
#+END_QUERY

Which renders the following:
image

I would like it to only display the child block.

Welcome.

The proper category for this is not Feature Requests, but Questions & Help.

To gather only the child block, should add one more line under :where:

[?child :block/parent ?b]

…then modify the pull like this:

(pull ?child [*])
1 Like

sorry, i think i had started a feature request draft this morning and it got mixed in.

Thanks! That worked perfectly.