Forum Discussion

jaread83's avatar
jaread83
Champion
9 years ago

REST V2 query for online users

Is there a way to get only online users from the database using API V2? I would normally use a WHERE online_status = 'online' but this returns offline users too! My query is also not suitable as it takes the first 1000 and loops to find online users. I have a database of 30,000 members and this just wont do. Here is my query for my component.

<#assign query = "SELECT login, view_href, avatar, online_status, registration_data, rank FROM users limit 1000" />

Can anyone suggest a way of modifying my query to only get online users?