Skip to content

failure with multiple arguments for a query #11

@rejozenger

Description

@rejozenger

This project is awesome. Solves the issue with not being able to export the output of logseq queries from the GUI of logseq. Thanks for this tool. I have one problem though.

I tried to write a script that prints all blocks that matches #report and #wordB (where the first is set, the second is variable) and withing a particular timeframe. The #wordB and the two dates should be arguments to the script.

lq q keyword media 20240701 20241001

This is what happens:

me@ix:~$ lq q keyword media 20240701 20241001
Error: Wrong number of arguments
Usage: lq q

The code that I am using:

:test/keyword
{
  :query [
    ;; Using pull to specify what you want to find; ?content should be specified correctly
    :find ?content
    :where
    [?b :block/content ?content]
    [(clojure.string/includes? ?content ?1)]   ;; First argument (search term)
    [(clojure.string/includes? ?content "report")]
    [?b :block/page ?p]
    [?p :block/journal? true]
    [?p :block/journal-day ?d]
    [(>= ?d ?2)]  ;; Second argument (start date)
    [(<= ?d ?3)]  ;; Third argument (end date)
  ]
}

Surely a user error, but I can't figure out what is going wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions