I try to remove more than one document with mongoose.
I've try something like this.
const result = await Order.remove({id: {$in: req.body.id}});
But, it doesn't work!
The output of req.body.id
is array
.
To make sure that req.body.id
is an array. I try something like this:
req.body.id.constructor === Array
and the output is true
What is wrong?
UPDATE
Here is my req.body.id : [ '5ab0a359672f32ad94c5aa2d', '5ab0a3d25e7bef513cd882ff' ]