#!/usr/bin/node

var MongoClient = require('mongodb').MongoClient,
    assert = require('assert');

var url = 'mongodb://localhost:27017/todo';
MongoClient.connect(url, function(err, db) {
  assert.equal(null, err);

  //insert(db, {"item": "have breakfast"}, function() {db.close();});
  find(db, function() {db.close();});
});

function find(db, cb) {
  var cursor = db.collection('todo').find();

  cursor.each(function(err, doc) {
    if(doc !== null) { console.log(doc); } else { cb(); }
  });
}

function insert(db, item, cb) {
  db.collection('todo').insertOne(item, function(err, result) {
    assert.equal(err, null);
    cb();
  });
}

@@ -218,70 +218,211 @@
   //
-insert(db, %7B%22item%22: %22have breakfast%22%7D, function() %7Bdb.close();
+db.collection('todo').insertOne(%7B%22item%22: %22have break%22%7D);%0A  db.collection('todo').updateOne(%7B%22item%22: %22have breakfast%22%7D, %7B%22itrem%22: %22have launch%22%7D);%0A  //db.collection('todo').deleteOne(%7B%22item%22: %22have break%22
 %7D);%0A
@@ -639,148 +639,4 @@
 ;%0A%7D%0A
-%0Afunction insert(db, item, cb) %7B%0A  db.collection('todo').insertOne(item, function(err, result) %7B%0A    assert.equal(err, null);%0A    cb();%0A  %7D);%0A%7D%0A

edit demo code