I have encountered a challenge with my MongoDB collection as it has grown significantly large, now containing 15k documents totaling nearly 15 MB in size. The website I am developing utilizes a map to display all elements, making pagination difficult. Each time I request data from my express backend, I receive an error related to the javascript heap running out of memory. You can see a screenshot of this error here.
How can I ensure that my website continues to function correctly while addressing these issues:
- Coping with the large database size
- Incorporating pagination into the design of my website
- Preventing backend crashes resulting from the current layout
I apologize if this question seems naive; this is my first time seeking assistance on Stack Overflow.