created function to write to mongodb
dbtest.js demonstrates that mongoInsert works