Closed jrschumacher closed 8 years ago
Could you give an example of how the following would be done?
app.use(function* (next) { this.mongo.db('test').collection('users').find({}, function (err, docs) { docs.toArray(function(err, doc) { doc.name += '!'; }); }); });
You may now use generator function instead callback. Say, yield db.collection("users").find().toArray() ;etc...
Dont forget also yield next;
Could you give an example of how the following would be done?