N1QL Multiple joins

If you are using 5.5 you can use ANSI JOIN
Otherwise can you update post with document key, so that will know if any relation is present or not.

Also checkout N1QL for merge 3 records