I have created a user schema in mongoose with various fields such as userName, firstName, lastName, password, rate, and rates. I am trying to perform a PUT request to store a new key/value pair in the rates object. Before updating the rates, I check if it is correctly initialized and then proceed to update it with the new data. However, despite logging the values before and after the update, I encounter an issue where the updated rates are not being saved properly. Here is an example of the output: First put request: {} 'before' { '5686e0b40a8c0bc90a4fb4cc': '4' } 'update' In the next put request: {'5686e0b40a8c0bc90a4fb4cc': '4'} 'before' { '5686e0b40a8c0bc90a4fb4cc': '5' } 'update' Unexpectedly, I end up with: {} 'before' { '5686e0b40a8c0bc90a4fb4cc': '5' } 'update' The issue lies in the saving of user.rates using the code snippet: user.save(); I need assistance in resolving this matter efficiently.