Python3+mongoDB follows the monthly, quarterly, half-yearly and full-year methods and ideas.

problem description

constant: number of active people, number of registrants, recharge amount, etc.
proportion: proportion of paid people, proportion of lost users, etc.
increase or decrease: the number of registered people rises year on year, the number of lost users decreases compared with last month

the environmental background of the problems and what methods you have tried

at present, constant data can be obtained or "timed time interval" data can be obtained according to the find () syntax in mongodb
but how to batch cycle the annual, quarterly and monthly data for calculation?

if there is source code in the previous question, it is no longer copy and paste. This question is just looking for ideas and methods

Apr.07,2021

in my practice, this kind of statistical data is made into intermediate data.
A service is scheduled to do statistics at a time point to generate statistics (month, quarter, half year, year) to a new collection.

has also seen online references to streaming (frameworks such as stom ). This is relatively complicated. I haven't put it into practice. We can communicate together.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e495f9-4456b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e495f9-4456b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?