I had to change the schema type of a field (location) in my Course model from array to string, I however need to change all previous data I have from type array to string and then do some data manipulation to get what I need. New data are being stored as String. How do I query all courses having location field type as array and where zip code exists so that I can do proper data manipulation?
const coursesWithArrayLocation = await Course.find({zipcode: { $exists: true }});