Please just help clarify whats happening inside these two function. I'm a bit more comfortable with mongoose as well. If you can provide a mongoose a equivalent that would be great as well.
router.put('/api/todos', function (req, res){
db.todos.update({
_id: mongojs.ObjectId(req.body._id)
}, {
isCompleted: req.body.isCompleted,
todo:req.body.todo
}, {}, function (err, data){
res.json(data);
});
});
router.delete('/api/todos/:_id', function (req, res){
db.todos.remove({
_id: mongojs.ObjectId(req.params._id)}, '',
function (err, data){
res.json(data);
});
});