Using MongoDB with spring mongo, I'm searching for a convenient and efficient way to copy documents matching a specific query and bulk inserting them again to the same collection with one of the attributes changed.
EDIT: Maybe the question wasn't clear enough: I'm not searching for a bulk update: In the collection, I want to find all documents matching foo="bar", change to foo="baz", and insert the changed documents as a copy in the same collection. AFAIR, the mentioned duplicate question doesn't cover this.
Any ideas on this?