I have a field in mongodb that's a string. {"field": "some text"}
, I want to convert them all into arrays. {"field": ["some text"]}
I know I can just loop through all the documents, get the field, then update, but I'm wondering if there's a cleaner way.
Thanks.
See Question&Answers more detail:os