MongoDB Modifying Properties In A Collection Using Angular /TypeScript Object.defineProperty


I’m trying to modify a property in a collection, according to my research It can be done. I have gotten it to work on fake backend using db.json format . In the Products collection there is a size property but no value, when the user clicks to add to a shopping cart the size is chosen. From my service on client side using Angular 16 I have a service that is called when size is chosen and add to cart. Example below

    addProductToCart(product:Product, _id:String, Valuesize:String){

    writable: true,
    enumerable: true,
    configurable: true,



There is a http post. I get the request and the size shows but when an insert is done on
MongoDB the property is not changed. I have tried everything I know. There are no errors. A
point in the right direction would be greatly appreciate. I have tried another resource forum
with no luck.