[379] 옵시디언 정기적인 유지관리에 도움이 되는 Dataview 쿼리 소개
shunnna

Lv.1 shunnna (39.♡.222.244)

2025년 4월 30일 AM 06:43

조회 466 공감 0

This query scans all notes in your vault for **external images** (i.e., image links starting with `http` instead of being stored locally) and lists the notes where such images are found along with their URLs.

Use it when you want to **identify and replace remote images with local copies** to ensure long-term accessibility and self-contained notes.


```dataviewjs

const pages = dv.pages();

const results = [];


for (let page of pages) {

const content = await app.vault.read(app.vault.getAbstractFileByPath(page.file.path));

const matches = content.match(/!\[\]\((https?:\/\/.*?)\)/g);

if (matches) {

results.push([page.file.link, matches.join("<br>")]);

}

}


if (results.length > 0) {

dv.table(["Note", "Liens Externes"], results);

} else {

dv.paragraph("Aucun lien externe d'image trouvé !");

}


This query lists all **orphan notes**: those that have **no links to other notes** and **are not linked from anywhere else** in the vault.

Use it to find **isolated notes that might need better integration** into your knowledge network or can be deleted or merged.


```dataview

LIST

WHERE length(file.outlinks) = 0

AND length(file.inlinks) = 0

SORT file.name ASC

```


This query finds the **oldest modified file** in your vault (excluding certain folders), showing when it was last edited.

Use it to surface neglected notes that may need revisiting, updating or archiving.


```dataview

TABLE file.mtime AS "Dernière modification"

FROM ""

WHERE !contains(file.path, "Solo-RPG") AND !contains(file.path, "4 - Vault maintenance stuff") AND !contains(file.path, "1 - Notes & projects")

SORT file.mtime ASC

LIMIT 1

```


This query lists the **smallest notes (under 2000 bytes)** in the `"2 - Efforts & projects"` folder, sorted by size.

Use it to quickly **spot stub or placeholder notes** that may need expansion, merging, or deletion.


```dataview

table file.size as "Taille (bytes)"

from "2 - Efforts & projects"

where file.size < 2000

sort file.size asc

```


This query retrieves all notes **tagged with `#YourTag`**.

Use it to quickly gather and review content organized under a specific tag, especially useful for topic-focused research or thematic exploration.


````query

#YourTag

````

댓글 (0)

  • 아직 댓글이 없습니다. 첫 댓글을 작성해보세요!

댓글을 작성하려면 이 필요합니다.