'use strict';
var Updater = require('landsat-meta-updater');

var u = new Updater('landsat', '8', 500);

// Update Elastic Search
u.updateEs(function (err, msg) {
  if (err) {
    console.log('Error:', err);
  }
  console.log(msg);
});

@@ -7,16 +7,45 @@
 trict';%0A
+require('envloader').load();%0A
 var Upda
@@ -82,16 +82,241 @@
 dater');
+%0Avar mongoose = require('mongoose');%0A%0Aconsole.log(process.env.MONGODB_URL);%0A%0Avar dbUrl = process.env.MONGODB_URL %7C%7C 'mongodb://localhost/landsat-api';%0Aconsole.log(dbUrl);%0Amongoose.connect(dbUrl);%0Avar db = mongoose.connection;
 %0A%0Avar u 
@@ -349,51 +349,165 @@
 8', 
-5
+10
 00);%0A%0A
-// Update Elastic Search%0Au.updateEs(
+db.on('error', console.error.bind(console, 'connection error:'));%0Adb.once('open', function () %7B%0A  console.log('connected');%0A  u.updateMongoDb(dbUrl, 
 func
@@ -524,16 +524,18 @@
  msg) %7B%0A
+  
   if (er
@@ -543,16 +543,18 @@
 ) %7B%0A    
+ 
+ 
 console.
@@ -579,10 +579,14 @@
 ;%0A  
-%7D%0A
+  %7D%0A  
   co
@@ -601,12 +601,38 @@
 g(msg);%0A
+    process.exit();%0A  %7D);%0A
 %7D);%0A

switch updater to mongodb