Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

151
Visualizações
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 Respostas
Responde à pergunta

0

I recommend using the official mongoDB driver. npm install mongodb

On their GitHub repository

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda