Query all tags present in notes under a root folder

This is the solution, thank you so much. Can I ask, how can I filter this further to just include the files that link to the current doc?