If it’s strict one time thing, to fix the tags, you could do it from the mongo console, but it depends on what you want to do. To find all devices that have at least one tag, you could use this on the mongo console:
db.devices.find({_tags: {$gt: []}}, {_tags: 1})
to remove all tags that start with “Tag_” from all devices that have just 2 tags :
db.devices.update({_tags: {$size: 2 }} , {$pull: {_tags: /Tag_.*/} }, {multi: 1})
to add test2 tag to all devices:
db.devices.update({}, {$addToSet: {_tags: 'test2'} }, {multi: 1})
to add test3 just for device with id xxxx-xxx-xxxxxxx:
db.devices.update({_id:"xxxx-xxx-xxxxxxx"}, {$addToSet: {_tags: 'test3'} })
hope you got the ideea, but please be carefull because you could lose all your data, backup first and use this at your own risk.