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

35
Vistas
ioredis - I can't filter data

First, I created a form. Every time users type an entry, it shouldn't be overwritten. so it needs to be added as an extra, I found the append command in redis and applied it. But now I don't know how to filter and fetch the data.

Append command, here I am making the data JSON

const newEntry = {
      owner_id,
      message,
      created_at: Date.now(),
      score: 1,
      ip: 'NA',
    }
await redis.append('features', JSON.stringify(newEntry))

JSON example, I need to filter with owner_id:

{"owner_id":30902468,"message":"test","created_at":1643755923014,"score":1,"ip":"NA"}

Redis docs here

ioredis

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

0

The APPEND works on strings, it's not exactly what you are looking for...

You can use lists and create a list for each user:

const newEntry = {
  owner_id,
  message,
  created_at: Date.now(),
  score: 1,
  ip: 'NA'
};

await redis.rpush(`features:${owner_id}`, JSON.stringify(newEntry));

await redis.lrange(`features:${owner_id}`, 0, -1);

In case you need to run more complicated queries, you should consider RediSearch + RedisJSON

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