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

161
Views
How to substitute $ for a parameter in Array Update Operators [Mongoose]

I have an apparently simple question, is it possible for me to replace the $ operator used to identify the index of an attribute array inside the mongoose for a variable that I have already passed as a parameter?

i.e. transform

$set: {"img.$]": req.params.imgUrl}

into something like

const indexDesired = req.params.indexParams // 0, 1 , 2

$set: {"img.indexDesired]": req.params.imgUrl}

thanks in advance for any and all help!

about 4 years ago · Juan Pablo Isaza
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!