S
S
Snewer2014-06-07 13:16:36
NoSQL
Snewer, 2014-06-07 13:16:36

How to store last user activity data in Redis

Hello!
How to store last user activity data in Redis?
Like "key_user_id" "time" or like a hash?
That is, with any action on the site, a record of the form "user id" - "time" is updated
thanks!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Solovyov, 2014-06-07
@Snewer

if you only need to know the time of the last activity, then store it like this:
the key users_last_activity:user_id is the value

E
evnuh, 2014-06-07
@evnuh

And for what purpose do you actually need this functionality? To show the date the user was last active, or to show active users over a period?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question