How to find pages with empty property?

I’d like to find all pages where a specific property (let’s say “project”) is empty.

The Search documentation does show how to find specific values, but mentions nothing about empty values.

Attempts like

  • [project:]
  • [project:empty]
  • [project:""]

do not seem to work.

Any help?

3 Likes

Workaround with regex:

/project:\s$

  • Exchange ‘project’ with any key.

When targeting empty values in multiline keys:

/.*?:\n\s{2}-\s$

  • Variants:
    /---[\s\S]*?.*?:\n\s{2}-\s$
    /---[\s\S]*.*?:\n\s{2}-\s$

Also, sometimes I see:
aliases: []

  • Query:
    /.*?:\s\[\]$
3 Likes

Thanks Gino, that’s a great solution.

Would be nice to have it integrated in the core search mechanism, though, so I made a post in Feature Requests.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.