Thank you for reaching out to the MongoDB Community forums.
May I ask if the document structure in the example is uniform across all documents in the collection? For instance, does field1 always contain field2, field3, and so on, and does all field2 contain the tags array? However, if the field names vary or the level of sub-documents is unpredictable, then it becomes difficult to do efficiently.
If the documents are freeform and the tags can appear anywhere (without a definitive structure that MongoDB can rely on for efficient document processing), two immediate options come to mind:
Return all documents to the app where they can be processed, or
use $where with a custom JS matcher. Note that neither option is great.
If this is a common workflow, would it be possible for you to reconsider the schema design so that this operation could be more efficient in the future?