Difference between revisions of "WebFund 2015W: Tutorial 5"

From Soma-notes
Jump to navigation Jump to search
(Created page with "In today's tutorial you'll be making a simple program, <tt>insertNote.js</tt> that can be run as follows: node insertNote.js <author> <title> <file with note contents> Whe...")
 
 
(One intermediate revision by the same user not shown)
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".
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:
Line 16: Line 16:


  npm install mongodb
  npm install mongodb
To get checked off show a TA your working <tt>insertNote.js</tt> or your progress working towards it by the end of tutorial time.

Latest revision as of 09: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.