!hPQtxfdYyypkeHbUKc:matrix.org

Logseq: Queries

2378 Members
This is the queries channel of the official Logseq Space on Matrix, which you can find at #logseq:matrix.org. | This channel is *not* bridged to the Logseq community on Discord.12 Servers

Load older messages


SenderMessageTime
1 May 2024
@_discord_1070154910324236309:t2bot.iojayp011 Hi all - I want to write a query which returns all the scheduled tasks before a certain number of days which is dynamically passed into the query as a function argument 13:41:41
@_discord_1070154910324236309:t2bot.iojayp011 changed their display name from j_._.p to jayp011.13:41:46
@_discord_1070154910324236309:t2bot.iojayp011 looked a lot into passing in arguments to functions but couldn't figure it out 13:42:00
@_discord_1070154910324236309:t2bot.iojayp011 is there anyone who has tried to execute a similar query 13:47:05
@_discord_1158778245085417482:t2bot.iojpi_joshg_09073 Is there a way to sort an advanced query results by each result's page name? I'm working with a team in the same graph. We use each day's journal page as an index for each person's daily notes, but each team member works on their own page with the following syntax 'yyyy-mm-dd-[initials]'. Since we aren't taking our notes in the daily journal page, our notes don't have a date associated with them and show up out of order in query results. 15:15:17
@_discord_1158778245085417482:t2bot.iojpi_joshg_09073 * Is there a way to sort an advanced query results by each result's page name?

I'm working with a team in the same graph. We use each day's journal page as an index for each person's daily notes, but each team member works on their own page with the following syntax 'yyyy-mm-dd-[initials]'. Since we aren't taking our notes in the daily journal page, our notes don't have a date associated with them and show up out of order in query results. Sorting by host page name should get our results in chronological order
15:16:35
@_discord_461306840840405003:t2bot.ioxarielml I have a page not in the journal which I can sort by date in query. I did this by making a date property that I use for each entry on the page. 18:43:16
@_discord_1070154910324236309:t2bot.iojayp011 anyone have any idea? I can get the scheduled tasks for today or tomorrow but if I wanna get tasks scheduled before 10 days or so I'm unable to figure it out 18:53:33
2 May 2024
@_discord_461306840840405003:t2bot.ioxarielml This query picks up all blocks with lit references (matching the input regex). I'd like to exclude blocks where the lit reference is a page - so it'd pick up @Test2024 but not [[@Test2024]]. Not sure how to approach this, is it even possible?
#+BEGIN_QUERY
{:title "References without pages"
:query
[:find (pull ?block [*])
:in $ ?input
:where
[(str "(?i)" ?input) ?pattern]
[?block :block/content ?content]
[(re-pattern ?pattern) ?captured]
[(re-find ?captured ?content)]]
:inputs ["@[a-zA-Z]+\\d{4}"]
}
#+END_QUERY
00:32:29
@_discord_461306840840405003:t2bot.ioxarielml * This query picks up all blocks with lit references (matching the input regex). I'd like to exclude blocks where the lit reference is a page - so it'd pick up @Test2024 but not [[@Test2024]]. Not sure how to approach this, is it even possible?
#+BEGIN_QUERY
{:title "References without pages"
:query
[:find (pull ?block [*])
:in $ ?input
:where
[(str "(?i)" ?input) ?pattern]
[?block :block/content ?content]
[(re-pattern ?pattern) ?captured]
[(re-find ?captured ?content)]]
:inputs ["@[a-zA-Z]+\\d{4}"]
}
#+END_QUERY
00:32:53
@_discord_410275881429499904:t2bot.ioAdmiralLogseeker changed their profile picture.00:49:31
@_discord_537045264997941248:t2bot.iodanadane. joined the room.04:17:44
@_discord_294314238057381888:t2bot.iodarbaga joined the room.04:45:05
@_discord_474845098388226049:t2bot.ioflaihigh. joined the room.07:03:41
@_discord_424110274937749504:t2bot.io.persici changed their display name from Persici to .persici.07:35:59
@_discord_696468060269445210:t2bot.ioun_qui_et changed their profile picture.10:22:56
@_discord_332855234743369731:t2bot.iomatpisarr joined the room.15:05:31
@_discord_626851001986711561:t2bot.iopenguin629 joined the room.16:21:26
@_discord_405571176610529291:t2bot.iobaalah joined the room.19:06:17
@_discord_1158778245085417482:t2bot.iojpi_joshg_09073 That's interesting, how do you pull that into the transform function? 19:08:40
@felipebarros:matrix.org@felipebarros:matrix.org joined the room.21:54:36
@felipebarros:matrix.org@felipebarros:matrix.org left the room.21:54:37
@_discord_682333513483026480:t2bot.ioyengecbey joined the room.22:02:26
3 May 2024
@jacob:katniss.topJacob joined the room.00:43:35
@_discord_781544564967997500:t2bot.ioviking2933 joined the room.08:07:59
@_discord_691753710363213854:t2bot.iohummushooman8524 joined the room.14:18:55
@_discord_773255737567870977:t2bot.iodown3355 joined the room.22:20:33
@_discord_773255737567870977:t2bot.iodown3355 Lads i'm sure this is a stupid question but i'm a complete beginner. How do I query for a random block in my vault 22:20:34
@_discord_773255737567870977:t2bot.iodown3355 changed their profile picture.22:20:34
@_discord_773255737567870977:t2bot.iodown3355 Thanks lads 22:20:36

There are no newer messages yet.


Back to Room ListRoom Version: 10