WebFund 2015W: Tutorial 5

From Soma-notes
Jump to navigation Jump to search

In today's tutorial you'll be making a simple program, insertNote.js that can be run as follows:

 node insertNote.js <author> <title> <file with note contents>

When you type the command

 node insertNote.js Anil "My first note" firstnote.txt

it creates a note with the title "My first note", authored by "Anil", with the contents of the note being the contents of the file "firstnote.txt". The note should be stored in the persistent-notes MongoDB database in the notes collection. (Be sure to preserve already existing notes!)

You should base you code on the following code:

* storeNotes.js
* fileStats.js

Note that in order to get storeNotes.js to run you will need to do the following first in the directory where storeNotes.js is:

npm install mongodb

To get checked off show a TA your working insertNote.js or your progress working towards it by the end of tutorial time.