So being new to meteor and mongo in general, I’ve written some code to create the necessary collections in mongo and set up the structure, my issue is that after every change and save when the app resets it adds redundant data to the database. This results in the database growing after every change, my questions are, 1.Is this normal. 2.If it is normal am I going about database set up the wrong way and will the way I’m setting it up effect the project in the long term? Pseudo code below:
var List = [-Arbitrary list elements here-]; //all strings var listLength = [5,15]; //split points in the list for something collection1 = []; collection2 = []; for(i = 0; i < list.length; ++i) { var current = new Mongo.Collection(List[i]); Candidate.insert({ //All this fun stuff here is being added over and over to the current collection after every small change and save to the code. bio: {---Stuff Here--}, experience: {---More Stuff--} }); if(i < listLength[0]) { collection1[List[i]] = current; } else { collection2[List[i]] = current; } }