diff --git a/services/Instagram/src/core/db.js b/services/Instagram/src/core/db.js new file mode 100644 index 00000000..c7a17312 --- /dev/null +++ b/services/Instagram/src/core/db.js @@ -0,0 +1,15 @@ +import {MongoClient} from 'mongodb'; +import co from 'co'; + +export var db; + +export function connect(uri){ + return co(function*() { + db = yield MongoClient.connect(uri); + return db; + }) +} + +export function collection(name){ + return db.collection(name); +}