Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

153
Vistas
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 Respuestas
Responde la pregunta

0

I recommend using the official mongoDB driver. npm install mongodb

On their GitHub repository

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda