l have 2 doc.
doc1:[ {a:1,b:10} {a:2:b:20}]
doc2:[ {a:1,c:100} {a:2:c:200}]
I want move doc2.c to doc1 when doc.a is same.
this is my command:
db.doc2.aggregate([ { $merge: { into: “doc1”, on: “a”, let: { c: “$c” }, whenMatched: [ { $addFields: { c: “$$c” } }], whenNotMatched: “discard” } }])
in mongo4.2 it works
in mongo4.4 is error: Cannot $merge to internal database: local.
is my command wrong?