Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
 
Answered
What are the uses of 'return_count' and 'page_number' in the new get_active_users_since() function?

In the latest Q2 SDK release, a new function called get_active_users_since() has been released that is a part of the UserLogon class. In the documentation, the function contains two parameters of note: return_count and page_number. For these parameters, what do they do and how should they be effectively used? On the function in general, how would one use the properties to get all of the active users within a specific timeframe? For example, if there are 37,809 active users within the past 90 days, how would these two parameters be configured to capture all of the users?

Docs: https://docs.q2developer.com/api_references/q2_sdk/db/db_objects/user_logon.html?highlight=userlogon#q2_sdk.hq.db.user_logon.UserLogon

Thank you,
Ethan

Posted 3 years ago
Votes Newest

Answers


Hello Ethan,

You can see the exact sql used for this here: https://code.q2developer.com/Q2Antilles/q2-sdk/-/blob/develop/sdk/q2_sdk/sql_scripts/10-get_active_users_since.sql

Getting that number of users is going to be very expensive. I would recommend getting like 1000 at a time and then looping incrementing the page_number untill you get all the users which would be when it returns 0 rows back.

-Trey

Posted 3 years ago
Trey Teter
124 × 2 Administrator
82 Views
1 Answer
3 years ago
3 years ago
Tags