Created
July 28, 2017 12:49
-
-
Save wtrocki/16631d12cf433bcaf854d2f825f761ca to your computer and use it in GitHub Desktop.
Database update script for adding assignee field
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Database update script for adding assignee field | |
| use raincatcher; | |
| db.getCollection('workorders').find({}, | |
| { id: 1, assignee: 1 }).forEach(function(workorder) { | |
| db.getCollection('result'). | |
| updateMany({ workorderId: workorder.id }, | |
| { $set: { assignee: workorder.assignee } }); | |
| }); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment