I have the following collection :
I use the following code to remove the element of the orderList array that matches the orderId. But it doesn't work.
Order.update({"_id":ObjectId(userOrder._id)},{"$pull":{"orderList":{orderId: "WPN-1645691337205"}}});
and I tried the following code as well
Order.update({"_id:":ObjectId("621741dcd40da387489093c2")}, {$unset : {"orderList.0" : 1 }});
Order.update({"_id:":ObjectId("621741dcd40da387489093c2")}, {$pull:{"orderList":null}});
Thanks, Jo
