I am dealing with a unique situation where I have an object created from dynamic checkboxes in Angular. The structure of the object looks like this:
{"United States":true,"Canada":true,"Australia":false}
While this format works well for storing values, I need to convert it into an array in order to perform database searches on the country values and save it to MongoDB/Mongoose as follows:
["United States":true,"Canada":true,"Australia":false]
After performing the database operation, I would then need to convert it back to the original object type for application use.
Can anyone suggest the simplest method to achieve this conversion process?