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

106
Views
update field with existing field in mongodb

mongodb structure is like;

[
    {id: "1" , name: "alex"},
    {id: "2" , name: "felix"},
    {id: "3" , name: "kelix"},
    {id: "4" , name: "hannah"}
]

Let's assume I want to add "s" each document in the document.

[
    {id: "1" , name: "alexs"},
    {id: "2" , name: "felixs"},
    {id: "3" , name: "kelixs"},
    {id: "4" , name: "hannahs"}
]


db.list.updateMany({}, { $set: {name: "$name" + "s"})}

But this followed by script contains errors.

Is it possible to update field with its existing value in mongodb?

over 4 years ago · Santiago Trujillo
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!