Skip to content

Rebuilding the model all the time causes memory issues #11280

Answered by vkarpov15
32bit asked this question in Q&A
Discussion options

You must be logged in to vote

Not currently. You should be able to reduce the memory usage by deleting the model before creating a new one.

mongoose.deleteModel('TestModel');
const mymodel = mongoose.model('TestModel', TestSchema, collectionName);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Uzlopak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants