Lists
Use Lists to store large amounts of data. List is a quick way to get and search data. Also list is preferred way for organize statistics.
List - it is a collection of properties or users.
Examples:
history (orders history, transactions, payments history, locations history, etc)
large price lists
table of cities with population
results for Inline Bot
referrals list
Do not use JSON property to collect a large array. This is a very bad practice.
"Execution timeout" error - it is typical error if you use JSON prop for large data.
Use a List.
List initialization
Before using the list (new or existing), you need to initialize it.
List can be global for Bot:
or can be personal for user:
After it you can perform another list methods
Create new list
Remove list
Recount list
Recalculate all statistical data in list.
Can spent 5-30 seconds and more for big list. So you need perform this task on background once in week/day or hour.
you can get delay time in ms:
recount lag:
Calculate the amount of all props and users
Need recount before
Properties management
Add bot property to bot list
Bot property can be added to List for bot
Example. Bot can have price list.
Add user property to user list
User property can be added to List for user
Example. User can have Orders list
Add user property to bot list
User property can be added to List for bot
Example. Bot can have top customers list.
Reject property
Reject property from list without destroying by prop name
Remove property
Reject property from list and destroy it by prop name
Reject all properties (and all users)
Reject all properties from list
this method reject all properties and all users from list
Remove all properties (and reject all users)
Remove all properties from list
this method remove all properties and reject all users from list
Users management
Add user
Reject user
Reject user from list
Reject all users
Reject all users from list
Getting data
Getting props from list
Getting users from list
Paginating
We have pages for data. Data is given page by page from the first page.
One page have 100 items by default.
User searching
Getting user by id from list
Checking the user's existence in the list
Statistics
Is available for integer and float props
Need recount before
Last updated