Now I get two collections: coll01 and coll02 .
And the structure of coll01 is as follows:
{ id: 01, name: "xxx", age: 30 }
and the structure of coll02 is similar:
{ id: 01, name: "XYZ" gender: "male" }
The two id fields in both collections are indexes. And the number of documents in these two collections is the same.
And what I want to do in traditional SQL:
update coll01, coll02 set coll01.name = coll02.name where coll01.id = coll02.id
source share