Skip to content

Commit 1aabf7e

Browse files
committed
vault: Save some experiments with query properties in searches - for docs
1 parent 1aca903 commit 1aabf7e

File tree

4 files changed

+79
-0
lines changed

4 files changed

+79
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
project: proj1
3+
---
4+
5+
# Project 1
6+
7+
- [ ] #task Task in 'Project 1'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
project: proj2
3+
---
4+
5+
# Project 2
6+
7+
- [ ] #task Task in 'Project 2' [[#Project 2]]
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
project: Project Search
3+
---
4+
5+
# Project Search
6+
7+
## Search 1
8+
9+
```tasks
10+
filter by function task.file.hasProperty('project')
11+
group by function task.file.property('project')
12+
```
13+
14+
## Search 2
15+
16+
```tasks
17+
filter by function task.file.hasProperty('project')
18+
filter by function task.file.property('project') === query.file.property('project')
19+
group by function task.file.property('project')
20+
```
21+
22+
## Search 3
23+
24+
Suppose you have a project property in your query file, and you want to find all tasks that link to a note with the name of the property:
25+
26+
```tasks
27+
explain
28+
(description includes [[{{query.file.property('project')}}]]) OR \
29+
(description includes [[{{query.file.property('project')}}|) OR \
30+
(description includes [[{{query.file.property('project')}}#) OR \
31+
(description includes [[#) AND (filename includes {{query.file.property('project')}})
32+
```
33+
34+
## Tasks
35+
36+
- [ ] #task Task 1 [[Project Search]]
37+
- [ ] #task Task 2 [[Project Search#Search 1]]
38+
- [ ] #task Task 3 [[Project Search|alias]]
39+
- [ ] #task Task 4 [[#Search 3]]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
workdate: 2024-04-01
3+
groupby: group by happens
4+
---
5+
6+
# workdate Example
7+
8+
Simple use of properties in Tasks searches.
9+
10+
## Due
11+
12+
```tasks
13+
#explain
14+
due before {{query.file.property('workdate')}}
15+
{{query.file.property('groupby')}}
16+
limit 10
17+
```
18+
19+
## Done
20+
21+
```tasks
22+
#explain
23+
done before {{query.file.property('workdate')}}
24+
{{query.file.property('groupby')}}
25+
limit 10
26+
```

0 commit comments

Comments
 (0)