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

150
Views
Saving string from POST to existing mongoDB file

I have created a post request that receives a users ethereum address from the users end. Next I need to add the string to the users existing record in a mongoDB database.

app.post('/post', async (req,res) => {
    res.set({ 'Content-Length': 64 })
    res.json(req.body)
    const address = JSON.stringify(req.body.address)
    let temp = address.length-2;
    var walletAddress = address.slice(2, temp) //This is to remove brackets and speech marks from the string
    walletAddress = utils.getAddress(walletAddress)
    console.log(walletAddress);
    res.end("yes");
    //saving data in an existing mongodb
    
});

I've tried so many different ways and they have all presented an error off some kind.

Sorry if this is really obvious I am a noob, but help is greatly appreciated

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I recommend using the official mongoDB driver. npm install mongodb

On their GitHub repository

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