router.post('/cart/del', (req, res, next) => {
let userId = req.cookies.userId;
let productId = req.body.productId;
console.log(userId)
console.log(productId)
User.findOneAndUpdate({userId: userId}, {$pull: {cartList: {productId: productId}}}, (error, document) => {
if (error) {
res.json({
status: '1',
message: error.message,
result: 'err'
})
} else {
res.json({
status: '0',
message: '',
result: 'suc'
})
}
})
});