re: Designing a better architecture for a Node.js API VIEW POST

TOP OF THREAD FULL DISCUSSION
re: I ran some tests some time ago and I realize that when you try to get the model multiple times this error could show up because we try to reinitial...
 

Yes wanted to do this but realized that it will be repeatation of code so I added a functionality to the
getInstance (init =true) {
init && initScheme();
return mongoose.model("your model name");
}

This is way better, nice job man!
I am going to change the structure of this model soon.

code of conduct - report abuse