Suppose I have 2 json documents of similar structure:
A. {"a:"{"b": 42}}
B. {"a":{"b": 1}}
My task is to find corresponding path in first document while having path of second document. For example, let find the diff of these 2 docuemnts: A diff B
.
the result will be the document {"a":{"b":1}}. The problem is to find the old value of a.b
key in document A. Documents can have arbitrary structure(but structure is same for 2 comparing documents)
EDIT after having val diff = A.diff(B)
how to get the document of such structure(or even whithout having diff
)?
{"a":
{"b":
{"old": 42, "new": 1}
}
}