selimrbd / py-obsidianmd

Python interface to your Obsidian notes
BSD 3-Clause "New" or "Revised" License
262 stars 21 forks source link

Filter on None or empty Metadata Value #13

Open Deano1406 opened 1 year ago

Deano1406 commented 1 year ago

Been trying to find all the notes where there is a Metadata Key, but there isn't a value.

I have tried three different ideas for empty values; mynotes.filter(has_meta=[('notetype', None, MetadataType.FRONTMATTER)])

mynotes.filter(has_meta=[('notetype', "", MetadataType.FRONTMATTER)])

mynotes.filter(pattern='^$')

They all return zero entries.

Being able to filter for keys that do not have a value would be very useful.