Okay so i am trying to create a mongoose insert using 2 sets of data from two variables i have set. When i try using the loop outside the db insert function it displays the data however inside the db i get the error unexpected token .forEach.
var storedaily = store['storefronts'][3]['catalogEntries'];
var storeweekly = store['storefronts'][5]['catalogEntries'];
//console.log(storedaily);
storedaily.forEach(function(key) {
console.log(key.devName);
});
var insertstore = new Shop({
storedaily.forEach(function(key) {
itemName: key.devName
});
});
insertstore.save();