Skip to content
Back to skills

2356 Dataview 8d7f3587

ASecurity

```dataview LIST FROM "folder" WHERE condition SORT field ASC/DESC LIMIT 10 ```

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added May 31, 2026
documentationgo

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned May 31, 2026

npx -y skills add tools-only/X-Skills --skill 2356-dataview_8d7f3587 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2356 Dataview 8d7f3587?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2356 Dataview 8d7f3587
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2356-dataview-8d7f3587/badge)](https://www.skillsdirectory.com/skills/tools-only-2356-dataview-8d7f3587)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Dataview Query Reference

## Query Types

### LIST Query

```dataview
LIST
FROM "folder"
WHERE condition
SORT field ASC/DESC
LIMIT 10
```

### TABLE Query

```dataview
TABLE col1, col2, col3
FROM "folder"
WHERE condition
SORT field DESC
```

### TASK Query

```dataview
TASK
FROM "folder"
WHERE !completed
GROUP BY file.link
```

### CALENDAR Query

```dataview
CALENDAR file.cday
FROM "06 - Daily"
```

## Source Selection (FROM)

```dataview
FROM "folder"                    # Specific folder
FROM #tag                        # Notes with tag
FROM [[Note]]                    # Notes linking to Note
FROM outgoing([[Note]])          # Notes linked from Note
FROM "folder" AND #tag           # Combine with AND
FROM "folder" OR "other"         # Combine with OR
FROM -"excluded"                 # Exclude folder
```

## Field Access

### Implicit Fields (automatic)

| Field | Description |
|-------|-------------|
| `file.name` | Filename without extension |
| `file.path` | Full path |
| `file.folder` | Parent folder |
| `file.link` | Link to file |
| `file.size` | File size in bytes |
| `file.ctime` | Creation time |
| `file.cday` | Creation date |
| `file.mtime` | Modified time |
| `file.mday` | Modified date |
| `file.tags` | All tags |
| `file.etags` | Explicit tags only |
| `file.inlinks` | Incoming links |
| `file.outlinks` | Outgoing links |
| `file.tasks` | All tasks |
| `file.lists` | All list items |

### Frontmatter Fields

Access YAML frontmatter directly:

```dataview
TABLE status, created, tags
FROM "01 - Projects"
```

### Inline Fields

Define inline fields in notes:

```markdown
Key:: Value
[Key:: Value]
(Key:: Value)
```

Access in queries: `WHERE key = "value"`

## WHERE Conditions

```dataview
WHERE file.name = "exact"
WHERE contains(file.name, "partial")
WHERE startswith(file.name, "prefix")
WHERE endswith(file.name, "suffix")
WHERE file.cday = date(today)
WHERE file.cday >= date(today) - dur(7 days)
WHERE contains(tags, "#important")
WHERE status != "completed"
WHERE !completed                  # For tasks
WHERE length(file.tags) > 2
WHERE any(file.tags, (t) => startswith(t, "#project"))
```

## SORT Options

```dataview
SORT file.name ASC
SORT file.mtime DESC
SORT status ASC, priority DESC   # Multiple fields
```

## GROUP BY

```dataview
TABLE rows.file.link
FROM "folder"
GROUP BY status
```

## Date Functions

```dataview
date(today)                      # Today
date(now)                        # Current datetime
date(tomorrow)                   # Tomorrow
date(yesterday)                  # Yesterday
date("2025-12-09")               # Specific date
dur(7 days)                      # Duration
dur(1 week)                      # Duration
file.cday.year                   # Extract year
file.cday.month                  # Extract month
file.cday.day                    # Extract day
```

## String Functions

```dataview
contains(string, "search")
startswith(string, "prefix")
endswith(string, "suffix")
replace(string, "old", "new")
lower(string)
upper(string)
length(string)
split(string, ",")
join(list, ", ")
```

## List Functions

```dataview
length(list)
contains(list, item)
all(list, condition)
any(list, condition)
filter(list, condition)
map(list, function)
sort(list)
reverse(list)
flat(nested-list)
```

## Inline Queries

Use prefix `=` for inline queries (configured in vault):

```markdown
Today is `= date(today)`
File count: `= length(filter(file.tasks, (t) => !t.completed))`
```

## DataviewJS

For complex queries, use dataviewjs code blocks:

```dataviewjs
const pages = dv.pages('"06 - Daily"')
  .where(p => p.file.cday >= dv.date('2025-01-01'))
  .sort(p => p.file.cday, 'desc');

dv.table(
  ["Date", "Tasks"],
  pages.map(p => [p.file.link, p.file.tasks.length])
);
```

## Common Patterns

### Recent Daily Notes

```dataview
LIST
FROM "06 - Daily"
WHERE file.cday >= date(today) - dur(7 days)
SORT file.cday DESC
```

### Incomplete Tasks by Project

```dataview
TASK
FROM "01 - Projects"
WHERE !completed
GROUP BY file.link
```

### Notes Modified Today

```dataview
TABLE file.mtime as "Modified"
WHERE file.mday = date(today)
SORT file.mtime DESC
```

### Tag Overview

```dataview
TABLE length(rows) as "Count"
FROM "vault"
FLATTEN file.tags as tag
GROUP BY tag
SORT length(rows) DESC
```

### Notes Created This Month

```dataview
LIST
WHERE file.cday.year = date(today).year
WHERE file.cday.month = date(today).month
SORT file.cday DESC
```

Files in this skill

  • README.md957 B
  • skill.md4.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.