How to find and update the nested object in MongoDB? I am trying but not working. Listen this in one document only of specific category. Fist I need to find a particular category then update the product stock.
await db.collection("protablekeyboards").findOneAndUpdate({ 'category': "portable_keyboards", "products.sku": sku}).project({ products: 1 }).toArray()
