You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ohm Ruby
Feels like a stupid question but.. how should I store a simple hash of
string key-values? Should I store it as a JSON string, or is there a
more 'native' way to do this?
Thanks
cyx
unread,
Jul 13, 2011, 7:19:22 AM7/13/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ohm Ruby
Hi hyn,
My first choice for this would be to use Ohm::Contrib (http://
github.com/cyx/ohm-contrib) and
it's typecasting module.
class User < Ohm::Model
include Ohm::Typecast
attribute :some_data, Hash
end
If I need more control over the data in-redis, I'll probably store it
as a HASH though.
Regards,
cyx
hyn
unread,
Jul 13, 2011, 7:45:19 AM7/13/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ohm Ruby
Okay, so it performs serialization under the hood.
Since my hash could be around 150+ bytes and I only need to retrieve
something like 10 bytes at a time, the redis HASH might make more
sense, so I don't have to read the entire hash.