I have some problem when I try to upsert my object with new ones(parsed from xml file),but I got the following error:
MongoError: exception: After applying
try to use
const product = productEntity.toObject(); ... delete product._id; ... Product.findOneAndUpdate({product_id: product.product_id}, product)