Quantcast
Channel: Active questions tagged redis+ruby-on-rails - Stack Overflow
Viewing all articles
Browse latest Browse all 873

Getting hash map result from sql query [duplicate]

$
0
0

I want to get a data structure like this after the sql query:-Users table has username and city. It has 10000 records

    {"cities_arry": {"NY": ["john", "Mich", "Roh", "Dh", "Vir"],"KL": ["Big", "ching", "qull"],          ...     }        }

update: it is not possible to store nested hash on redis. So have to use MongoDb or some other tool.

  • Suppose you have a table users and you have city and username, and you want to find a data structure like above, then how would you approach

How to get faster query result to get data structure like this.


Viewing all articles
Browse latest Browse all 873

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>