I am pretty new to Meteor and am in the process of writing a TreeView. It reads its data from a collection which is in the following format:
name: ‘top level’
name: ‘top level child 1’
name: ‘top level child 2’
name: ‘top level child 2 - child’
… and so on
When developing I created my own test data and it all worked great and was very fast. However, I have now imported the actual data it needs to read from which consists of over 50,000 documents and it is unusable (taking around 10 seconds to display).
I have published/subscribed the whole collection with the 50,000 documents, but the treeview only reads the data it needs based on what is displaying on the screen at any time e.g. to start with it only displays nodes for documents where the parentID is null (to show the top level) and when the user clicks a node then queries to get the documents for that branch.
Can anyone suggest a way to write this so that it is fast?