This is the finished code from a tutorial that I wrote about saving data to a MongoDB database from a Node.js Application. You can read the tutorial to get step-by-step instructions on how to save data to a MongoDB database.
schewed/node-mongo-demo
Demonstration of connecting to a MongoDB database from a Node.js application
JavaScript