This commit is contained in:
tmshv committed 2016-03-23 02:06:52 +03:00
1 parent c7cd375757
commit 2028aacf08
1 file changed
+15
+15
View File
@@ -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);
}