From 565c20d8746bc240621d14016eade827704052ba Mon Sep 17 00:00:00 2001 From: Orion Yeung <11580988+YeungOnion@users.noreply.github.com> Date: Wed, 11 Oct 2023 15:53:07 -0500 Subject: [PATCH] Update Advanced Queries.md Add info regarding how to find page/block data available to use in queries as well as listing the functions in the query dsl. --- pages/Advanced Queries.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/pages/Advanced Queries.md b/pages/Advanced Queries.md index 6c2f5b66..6fd83c9e 100644 --- a/pages/Advanced Queries.md +++ b/pages/Advanced Queries.md @@ -138,6 +138,33 @@ description:: Advanced queries are written with [Datalog](https://en.wikipedia.o - `:Xd-after-ms` - Timestamp of X days after today. **New syntax** `:+Xd-ms` - `:start-of-today-ms` - Timestamp for beginning of today. **New syntax** `:today-start` - `:end-of-today-ms` - Timestamp for end of today. **New syntax** `:today-end` + - ### Query parameters and functions + created-at:: 1697057234 + updated-at:: 1697057234 + - You'll see example queries below that compose concepts expressed in this section. + View [comments in the source](https://github.com/logseq/logseq/blob/master/src/main/frontend/db/query_dsl.cljs/#L22-L48) + - #### Page data + - Page data can be viewed by opening the "(Dev) Show page data" from the page's context menu. This is made available by enabling [[Developer mode]]. + - #### Block data + - Block data can be viewed by opening the "(Dev) Show block data" from the block's context menu. This is made available by enabling [[Developer mode]]. + - #### Logical Operators + - and + - or + - not + - #### Filters + - `between` + - `property (block)` + - `task (block)` + - `priority (block)` + - `page` + - `sample` + - `full-text-search ""` + - #### Namespace + - `page-property (page)` + - `page-tags (page)` + - `all-page-tags` + - #### Sorting + - `sort-by (data) (asc|desc)` - ## Query Examples - 1. Get all tasks created_at:: 1609232063516 @@ -408,4 +435,4 @@ description:: Advanced queries are written with [Datalog](https://en.wikipedia.o - [Datomic query documentation](https://docs.datomic.com/query.html) - Thorough reference for datomic dialect of Datalog. Explains most datalog concepts well - https://nextjournal.com/try/learn-xtdb-datalog-today/learn-xtdb-datalog-today - Interactive datalog tutorial for engineers - [Datascript's intro docs](https://github.com/tonsky/datascript/wiki/Getting-started) - - [Logseq's database schema](https://github.com/logseq/logseq/blob/master/deps/db/src/logseq/db/schema.cljs) \ No newline at end of file + - [Logseq's database schema](https://github.com/logseq/logseq/blob/master/deps/db/src/logseq/db/schema.cljs)