Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion pages/Advanced Queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of this section is already written in https://docs.logseq.com/#/page/queries and putting it in this page is unfortunately incorrect. There are already a couple of references to "simple query" in this page. I could link simple query to https://docs.logseq.com/#/page/queries if that helps

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could see this being useful. Mentioning the 'Show page data' and 'Show block data' commands under Query Tips number 5 would be great.

- 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
Expand Down Expand Up @@ -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)
- [Logseq's database schema](https://github.com/logseq/logseq/blob/master/deps/db/src/logseq/db/schema.cljs)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this link is broken, maybe it should point to the model file? https://github.com/logseq/logseq/blob/master/src/main/frontend/db/model.cljs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not seeing an issue with the current link