Under construction!

↩ Home

Dataview snippets

A collection of Dataview queries I've been using in my Obsidian vault
2026-10-21

Preface

I like using Obsidian for a myriad of reasons but one of them is the fact that you can just turn your notebook into a database which you can query using a query language or through JavaScript code thanks to the Dataview community plugin. In this post I'd like to share some of the queries I've been using in my vault. This post will be continuously updated.

Language-related queries

My vault is bilingual: it has notes written in both Norwegian and English. I've made a property to track which language my notes are written in, which lets me get an overview of where I've used either the English or Norwegian language.

List & count files that do not have the property "language" on them

Naturally as I've introduced a new property there's going to be a ton of work related to updating each note with the new property. In order to make this task easier I've made a query to list all of the files which do not have the property "language" in the frontmatter:

```dataview
LIST
WHERE !language
```

I also have a string to show the count of files which do not have the property "language" using an inline Dataview JS query.

There are `$= dv.pages('""').where(p => !p.file.frontmatter.language).length` files which are missing the property `language`.

List & count the files in a specific language

Norwegian

I use the following snippet to show a list of notes which are written in Norwegian:

```dataview
LIST
WHERE language = "Norsk"
```

To count the notes which are written in Norwegian, I use this inline query:

Det er `$= dv.pages('""').where(p => p.language == "Norsk").length` notater skrevet på norsk.

English

This is the same as the Norwegian view but the entries of Norsk are replaced with Engelsk.

The following view will list the notes which are written in English:

```dataview
LIST
WHERE language = "Engelsk"
```

The following inline query will show a count of notes which are written in English:

There are `$= dv.pages('""').where(p => p.language == "Engelsk").length` notes written in English.

Miscellaneous

List & count of "Untitled" notes

I have a lot of "Untitled" notes in my vault, which are made by accident. This view wil list them:

```dataview
LIST
WHERE contains(file.name, "Untitled")
```

And this will show a count of them:

There are `$= dv.pages('""').where(p => p.file.name.includes("Untitled")).length` untitled notes.