var winston = require('winston');
var express = require('express');
var MongoClient = require('mongodb').MongoClient;

var app = express();

var collection;

function errCheck(e) {
  if(e) {
    winston.error(e);
    //throw e;
  }
}

winston.add(winston.transports.File, { filename: '/nodelogs/logs.log' });
//winston.remove(winston.transports.Console);

var MONGO_IP = process.env.MONGOSERVER_PORT_27017_TCP_ADDR;

MongoClient.connect('mongodb://' + MONGO_IP + ':27017/test', function(err, db) {
  errCheck(err);

  if(!db) {
    return;
  }
    
  collection = db.collection('test_insert');
  collection.insert({ theBest: 'Raf' }, function(err, docs) {
    if(err) {
      winston.error(err);
      throw err;
    }
    winston.info('Inserted', docs);
  });
    
});

app.get('/', function (req, res) {
  if(collection) {
    collection.find().toArray(function(err, results) {
      errCheck(err);
      res.json(results);
      return;
    });
  } else {
    res.send('No mongo connection :(');
    return;
  }
});

var server = app.listen(8080, function () {
  var host = server.address().address;
  var port = server.address().port;

  console.log('Example app listening at http://%s:%s', host, port);
});

@@ -210,18 +210,16 @@
 e);%0A    
-//
 throw e;
@@ -621,16 +621,26 @@
 t: 'Raf'
+, count: 0
  %7D, func
@@ -822,24 +822,142 @@
 llection) %7B%0A
+    collection.updateOne(%7B theBest: 'Raf'%7D, %7B $inc : %7B count: 1 %7D %7D, function(err, results) %7B%0A      errCheck(err);%0A%0A  
     collecti
@@ -997,32 +997,34 @@
 esults) %7B%0A      
+  
 errCheck(err);%0A 
@@ -1018,24 +1018,26 @@
 Check(err);%0A
+  
       res.js
@@ -1055,24 +1055,26 @@
 ;%0A      
+  
 return;%0A
     %7D);%0A
@@ -1065,16 +1065,26 @@
 return;%0A
+      %7D);%0A
     %7D);%0A

Update node-mongo app