How to perform the and operation in redis like mysql?

如何执行和操作redis如MySQL?

Tags: redis
标签: redis

问题 (Question)

Select * from student where id=1 and college='sss' so how it will achieved in redis databas.

选择*从学生那里id = 1和学院= 'sss所以它将如何在使用数据库的实现。

最佳答案 (Best Answer)

What you are describing is a query you could perform on an SQL database.

Redis however is a key-value store. Therefore it does not work with SQL queries.

I suggest trying the interactive tutorial to get an idea.

你所描述的是一个你可以执行一个查询SQL数据库

redis不过是一个键值存储。因此,它不与SQL查询的工作。

我建议尝试交互式教程得到一个想法。

答案 (Answer) 2

You'd have to maintain your own index, for example in a HSET, or use a package like stdnet, which does the indexing for you.

你必须保持自己的指标,例如在改善,或使用这样的包stdnet为你所做的,索引。

本文翻译自StackoverFlow,英语好的童鞋可直接参考原文:http://stackoverflow.com/questions/21424966