WebFund 2015W: Tutorial 5: Difference between revisions

From Soma-notes
No edit summary
No edit summary
 
Line 7: Line 7:
   node insertNote.js Anil "My first note" firstnote.txt
   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 <tt>persistent-notes</tt> MongoDB database in the <tt>notes</tt> collection.
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 <tt>persistent-notes</tt> MongoDB database in the <tt>notes</tt> collection. (Be sure to preserve already existing notes!)


You should base you code on the following code:
You should base you code on the following code:

Latest revision as of 13:09, 23 February 2015

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.