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

164
Vistas
Logging object but not able to log the object keys

I have saved an object in Redis in this format

 let redisObject = {
  sessionID: this.data.sessionID,
  forWardTime: new Date(),
 };

I am calling the object and the data is being retrieved successfully

  let redisData = await this.getDataFromRedis ....

And the weird part I am being able to log the Redis data example

console.log("redisData =>",redisData)

it is returing

redisData => {"sessionID":"OyMUuUgeimTeU3OfNWyDtgkGeHsniF","forWardTime":"2022-03-22T19:16:05.507Z"}

But

console.log(redisData.sessionID) 

And

console.log(redisData.forWardTime)

are both returning undefined? What's the problem and what am I missing

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Your getDataFromRedis() function isn't parsing the data, so you're logging the JSON string, not an object.

Change to:

let redisData = JSON.parse(await this.getDataFromRedis(...));
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