How do I form a and/or filter for a base file?

I’d like to form a filter for a base file that has the form
{A and B} OR {C and B}, for a simple example, look for all .md files in directory A OR in directory B.

I can’t seem to get it right. The only thing I can think of is to set the condition that for all views, look for files with md extension, then for this view set file path A OR B.

The problem is that it requires ALL the views in the base file to be of one extension, so I can’t have different views search for different extensions.

Press + Add filter group and change the conditions as needed among “all”, “any”, and “none”. And/or use boolean operators && and ||.

In the YAML, that would be either of these:

filters:
  and:
    - (A && B) || (C && D)
filters:
  or:
    - and:
        - A
        - B
    - and:
        - C
        - D

or your flavor of combination.

In the Bases interface, that looks like either or a combo of these: