I have a Python script that sends 3000 rows to a Meteor MongoDB collection, and after a few minutes, deletes all the documents inside the collection, and then re-uploads 3000 documents. This process repeats every few minutes.
On my UI, I have a table displaying all 3000 documents and a text box showing the count of documents (i.e. “3000”). The UI isn’t fast enough to render this when the Python script executes and makes changes to the database. Because of this, the text box goes from 0 to 260 to 500 to 1600 to 3000 (since it takes some time to load up 3000 rows in the table). Is there a way I can either:
- Prevent the text box from showing intermediate database changes, i.e. it should go from 0 straight to 3000.
- Prevent the UI from rendering at all until all 3000 rows/documents are deleted and re-uploaded.
I read something about ready() but don’t know how to implement that. Thanks.