I have a pinia store that has a user object..
export const useStore = defineStore('store', {
state: () => ({
currentSlide: 1,
user: {},
data,
}),
})
I am then updating it to have a an array vote inside the user object
And then the vote array has multiple objects as votes.. so I have the array as a user.vote which then is in this format [{vote:01},{vote:02}.{vote:3}]
I need to push this array to mongodb.. but when I try to access this array, as it's reactive data, it's a Proxy Object with multiple Proxy Objects inside of it..
So I tried toRaw(user.vote) (not sure if this is the right approach) and the array was no longer a Proxy but a regular array.. however the objects (votes) inside of it are still Proxy Objects..
How do I get a regular array with regular objects from this pinia structure to send to mongodb?