Filters narrow down which notes appear in a base by evaluating an expression against each note’s properties and metadata. Filters can be applied globally at the top level of theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/kepano/obsidian-skills/llms.txt
Use this file to discover all available pages before exploring further.
.base file — in which case they restrict every view — or per-view inside a specific view’s filters: key, in which case they apply only to that view. Both locations accept the same filter syntax.
Single Filter
The simplest filter is a plain string expression. When the value is a single expression, write it directly as a string:filters: key.
AND Filters
Useand: when all conditions must be true. Supply a list of filter expressions or nested filter objects:
OR Filters
Useor: when any one condition being true is sufficient:
NOT Filters
Usenot: to exclude notes that match any of the listed conditions:
Nested Filters
Filter objects can be nested arbitrarily. An item inside anand:, or:, or not: list can itself be a filter object with its own key. This lets you express complex boolean logic:
tag, OR if it has both book and links to Textbook, OR if it has neither the book tag nor is located in Required Reading.
Filter Operators
The following operators are available inside filter expressions:| Operator | Description |
|---|---|
== | Equals |
!= | Not equal |
> | Greater than |
< | Less than |
>= | Greater than or equal |
<= | Less than or equal |
&& | Logical AND (within a single expression string) |
|| | Logical OR (within a single expression string) |
! | Logical NOT (within a single expression string) |
&&, ||, and ! can be used inside a single filter string for simple inline boolean logic. For multi-condition logic it is generally clearer to use the and: / or: / not: object syntax.
File Filter Functions
The following functions are available on the built-infile object and are especially useful in filters for scoping a base to a particular tag, folder, or link relationship.
file.hasTag()
Returns true if the file has any of the specified tags. Accepts one or more tag arguments.
file.inFolder()
Returns true if the file is located inside the specified folder or any of its subfolders.
file.hasLink()
Returns true if the file contains an internal link to the specified file.
file.hasProperty()
Returns true if the file’s frontmatter contains the specified property (regardless of its value).
if() guards in formulas.