Dot notation in MongoDB is used for indexing into both arrays and embedded documents. The Cannot create field error suggests there is a problem updating your document based on the structure and the field paths you are trying to set. Your Stack Overflow post mentions updating an object within an array, but we need to see the document for context.
Please provide some more information to help reproduce your issue:
Great that you were able to find a solution! If you’d like some help trying to understand why the original approach didn’t work, please provide the further details I requested so we can try to reproduce this.