At some point data was saved as a string instead of an array of strings. There are some records that now have a value of:
users: "[email protected]"
but it should be:
users: ["[email protected]"]
Is there a way to update this in MongoDB?
Something like is what is a start, but I don't want to lose the data in the field. I need that info still, just inside an array:
db.users.update({users: {$type: 2}, {$set: {users: {$type: 4}})