Create a table where all the tags in my vault are listed, except the ones in folders “folder 1” and “folder 2”. Along with that, I’d like to get the number of documents that have that tag.
Things I have tried
Frankly, I went through the documentation but couldn’t figure out how do I even query the number of docs with those tags.
What is does is flip all the bits in a number, which essentially changes the sign from positive to negative and increasing the value by 1.
I use it here because it means you don’t have to initialise the output object with any values - you can flip the bit of undefined and make it -1. Then I negate the number which turns it into 1.
The next time it adds to that value, it turns the 1 into -2, which I negate back into 2.
I can like that feature/hack/…, and I have encountered the error of doing “undefined + 1” before, and had to rewrite my expression.
So I’m going to add this to my toolbelt (if I remember it the next time I encounter this). Just a little sad that it’s not intuitive what it does, and as such renders the code a little less readable (and understandable).