S
S
serious9112016-05-26 13:23:10
Redis
serious911, 2016-05-26 13:23:10

Search by value (Node.js + Redis)?

Redis stores a large number of objects (HMSET):

{
size:6
.....
}

It is necessary to do an asynchronous search by the size field of objects (for example, size >= 4), find the first match and stop the search (so as not to load the server with a large number of objects ~ 100k).
In relational databases, this can be done using 1 SQL query, but is it necessary in NodeJS + Redis? fetch the entire collection of objects from Redis and traverse it manually. The situation is further complicated by asynchrony, callbacks, and error handling during data retrieval from Redis.
Can you please tell me how to approximately implement this task using Node.JS?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2016-05-26
@bingo347

redis - key-value storage, what the hell is a search?
In your case, it is better to use a documentary (mongodb, rethinkdb, etc.)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question