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

32
Views
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 answers
Answer question

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 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!