List all child pages in the parent page

I would like to query a list of all children pages of the current page. I have used the below query from the following link, but the result includes the parent as well in the list. How can I only get the child pages?

I’m running this query in the “Parent” page

Below is an example page structure:

- Root
   - Parent
        - Child1
        - Child 2
{ :title "Current Members"
  :query [:find (pull ?p [*])
                :in $ ?parent
                [?p :block/name ?name]
                [(clojure.string/starts-with? ?name ?parent)]
                [(clojure.string/includes? ?name  "/")]]
  :inputs [:current-page] }

my hunch is that I need to change the last function [(clojure.string/includes? ?name "/")]], because this is returning true for the “Parent” as well since its name is “Root/Parent”.

I tried this: [(clojure.string/includes? ?name (apply str [?parent "/" ]))]]

But I can’t seem to figure out the clojure syntax to write

Suggestion for a completely different query :slight_smile:

{:title "Current Members"
 :query [:find (pull ?p [*])
  :in $ ?current
   [?c :block/name ?current]
   [?p :block/namespace ?c]
 :inputs [:query-page]