const postDocActionFct = (error, doc, action) => { if (error) prn(error); else prn(`${action} "${doc.toString()}"`); }; const recSchema = mongoose.Schema({ w: Number, h: Number }); //table name is all lowercase and plural -- e.g. "recs" const Rec = mongoose.model('Rec', recSchema); let rec; prn('WOW'); rec = new Rec(); rec.set('w', 10); rec.set('h', 2); rec.save(postDocActionFct); rec = new Rec(); rec.set('w', 8); rec.set('h', 7); rec.save(postDocActionFct);