"use strict";
const dbConnection = require("./mongoConnection");
/*
 Created by lx on 2016/10/17
 Name: Xuan Li
 CWID:10409939
 Email: xli100@stevens.edu
 */
/* This will allow you to have one reference to each collection per app */
/* Feel free to copy and paste this this */
let getCollectionFn = (collection) => {
    let _col = undefined;

    return () => {
        if (!_col) {
            _col = dbConnection().then(db => {
                return db.collection(collection);
            });
        }

        return _col;
    }
}

/* Now, you can list your collections here: */
module.exports = {
    cities : getCollectionFn("cities");
    sites : getCollectionFn("sites");
    food : getCollectionFn("food");
    users : getCollectoinFn("users");
    blogs : getCollectionFn("blogs");
};


@@ -1,12 +1,13 @@
+%0A
 %22use strict%22
@@ -602,22 +602,56 @@
 = %7B%0A    
-cities
+user : getCollectionFn(%22user%22),%0A    city
  : getCo
@@ -669,14 +669,12 @@
 %22cit
-ies%22);
+y%22),
 %0A   
@@ -678,17 +678,16 @@
     site
-s
  : getCo
@@ -702,20 +702,19 @@
 Fn(%22site
-s
 %22)
-;
+,
 %0A    foo
@@ -744,19 +744,18 @@
 od%22)
-;
+,
 %0A    
-users
+blog
  : g
@@ -767,61 +767,138 @@
 lect
-o
 i
+o
 nFn(%22
-users%22);
+blog%22),
 %0A    
-blogs : getCollectionFn(%22blogs%22);
+image : getCollectionFn(%22image%22),%0A    comment : getCollectionFn(%22comment%22),%0A    type : getCollectionFn(%22type%22),
 %0A%7D;%0A

Update mongoCollections.js