11:50:03 GMT hi, i’m using ruby and i have a class that looks like Cat < RedisModel … i want to ask how to find the field names of a redis model? 11:51:13 GMT if your thing is a hash in redis: HKEYS. no idea how that translates to whatever ruby framework you're using 12:09:07 GMT minus: thanks. and if it’s a set? 12:10:05 GMT SMEMBERS 12:10:26 GMT see https://redis.io/commands/ for all availble commands 12:15:13 GMT minus: thank you :) 15:52:48 GMT Hey, could someone explain me what does the 0 mean in redis url like this: redis://127.0.0.1:6379/0 ? 15:59:39 GMT granitosaurus: database id most likely 15:59:57 GMT oh ok, so redis can have multiple databases? 16:00:06 GMT yes, 16 by default 16:00:14 GMT lovely! Thanks minus 16:00:35 GMT they're numbered and the amount can be configured in the config file 16:53:46 GMT Hey, I want to a) "Find item by it's key" and b) "Find multiple items by value of property", should this be doable with redis? Here is example how items are stored right now https://paste.debian.net/926742/ 16:54:56 GMT So in this case I can find item easily by key, but can I find items whose thread_id is 2? 16:58:49 GMT Hello. Is there any redis native type to store data structures like ["user1": ["pole", "liked!"], "user2": ["liked", "disgusting"]]? (comment's system) 17:13:40 GMT Jonuz: create a set thread_id:2:messages with message ids. but if you need something like that redis might not be what you're looking for 17:14:22 GMT jimeno: no, but you can e.g. json-encode the values of the hash 17:16:07 GMT minus: read today about using json encoding or pickle for that. What's the best choice? 17:16:34 GMT redis doesn't care, it's up to you. json has the advantage of being readable 17:16:44 GMT and of not being able to execute code 17:18:44 GMT minus: any good documentation on how to pub|sub? I mean I cannot find any good resource on how to subscribe my userA to channels from userB and userC without infinite loops listening for messages 17:19:08 GMT minus: yup, pickle has somewhat the kind famous pho object injection vuln :/ 17:19:58 GMT also, json works with other languages than python 17:21:00 GMT jimeno: when you do pubsub on a redis connection you can't use it for anything else and you need to run it in a loop 17:23:19 GMT minus: then, if I want to receive for example messages from all users I subscribe to, is it possible to implement that with redis? 17:23:32 GMT I thought about when I follow userN, I subscribe to his channel 17:23:45 GMT but if it must run in a loop... I'm out of ideas 17:24:01 GMT do you also store messages in redis? if yes, check keyspace notifications, but that's a different story 17:24:33 GMT how does your client look like? 17:25:20 GMT minus: I thought about implementing a comments system, but for now I want to be able to receive notifications from the users I follow 17:26:23 GMT but what's your client; a python app the user runs on their system and that connects to redis. or a website using websockets/SSE? 17:26:39 GMT minus: my users've an uid to unique identify them, and when I follow userA (which uid is == 1), for example, my redis adds my uid to user:uid:1:followers 17:27:00 GMT minus: python app that I run in separate ttys 17:27:12 GMT one process per tty? 17:27:19 GMT tty_1 is userA, tty_2 is userB and etc 17:28:49 GMT then on startup get the list of followed people, and subscribe to each of their channels with one redis connection (and optionally have another if you need to do other things) 17:29:24 GMT minus: separated threads? (to be able to listen to the channel in a loop) 17:32:46 GMT yeah, you'll probably need threads there 17:32:59 GMT or an event loop 17:33:59 GMT minus: will give it a try. Thank you very much! 20:04:55 GMT hey folks. I did a dumb thing. I did a GEOADD for about 1.2M records, but I got the LAT and LON backwards. Is there an easy way to flip them? 20:05:54 GMT no, remove the key and re-add everything 20:06:22 GMT it's just geohashed and added to a zset, right? 20:06:49 GMT 1.2M records shouldn't take long anyway 20:07:42 GMT it shouldn't take long, but I don't want to re-add everything from scratch, over the network 20:07:59 GMT because over the network (against an API) it'll take over a week 20:08:08 GMT ouch 20:08:18 GMT I should be able to do it in place, or at least on disk 20:08:20 GMT just shove the script onto the machine? 20:08:33 GMT but, I'm a redis noob, and I'm not sure how to approach it 20:08:39 GMT yeah, I guess I could script it 20:08:47 GMT feels like a hack, but I guess that's the best I got 20:09:16 GMT well, you'd need to fetch the data, decode the geohash, flip it and readd it anyway 20:11:08 GMT ah, right, it's hashed 20:11:23 GMT it doesn't store the LAT and LON vals anywhere as-is, right? 20:12:01 GMT no 20:13:06 GMT https://redis.io/commands/geoadd#how-does-it-work