Updating a document based on another field

How can I use update() to update all documents by adding a new field based on value of an existing field in same document

I tried to use $ in value of $set but it didnt work



I want to update all documents to add new field f3 which should be the value of f2


above didnt work , it is setting string $f2

See the answer from this thread:

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.