1
0
CompleteNodeJS/task-manager/playground/promise-chaining-2.js

12 lines
295 B
JavaScript
Raw Normal View History

2020-02-23 23:03:48 +00:00
require('../src/db/mongoose')
const Task = require('../src/models/task')
Task.findByIdAndDelete('5e52f573b7d229017fe21321').then((task) => {
console.log(task)
return Task.countDocuments({ completed: false })
}).then((result) => {
console.log(result)
}).catch((e) => {
console.log(e)
})