N1QL - How do you compare 2 document in N1QL and show only difference on all the attributes including array with simple N1QL statement

I don’t it is possible. It is hard to represent out put as JSON.

If both documents has identical fields and one level

SELECT  OBJECT v:doc1[v] == doc2[v]
                    FOR v IN OBJECT_NAMES(doc1) END
LET doc1 = (SELECT RAW d FROM default USE KEYS "k01")[0],
         doc2 =  (SELECT RAW d FROM default USE KEYS "k02")[0];