Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

309
Views
In Vue3, how to convert Nested Proxy Objects (Reactive data) to regular objects?

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?

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!