I don’t know why you want your query run on startup only. But if it’s then you need to store it somewhere on your server: mongodb database, memory storage…
Then on the client, you call a method (or using pub/sub, but I don’t recomend) to fetch those data.
Then you need some kind of cronjob to fetch the data daily. The code in startup function run once only when you start the app. In the real life, your app will stay up and running for months, even years. You don’t want that code runs only once a year, I guess.
there is a problem that it will take time to load data from the database, but after loading the page, the data has not been fully loaded, how to finish loading the database into mongo, the main page will load?
Hello there! I’ve done some things with PG and Meteor these past few days. I’ve made this template/boilerplate on how to use Prisma + Postgres, which may be a good solution. In summary, you will need two methods, one for querying the data and another for mutating that data. It can be seen here on this folder