{"action":"created","issue":{"url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/181","labels_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/181/labels{/name}","comments_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/181/comments","events_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/181/events","html_url":"https://github.com/jagi/meteor-astronomy/issues/181","id":115717624,"number":181,"title":"Bug: When update nested array of object","user":{"login":"zhaoyao91","id":3808838,"avatar_url":"https://avatars.githubusercontent.com/u/3808838?v=3","gravatar_id":"","url":"https://api.github.com/users/zhaoyao91","html_url":"https://github.com/zhaoyao91","followers_url":"https://api.github.com/users/zhaoyao91/followers","following_url":"https://api.github.com/users/zhaoyao91/following{/other_user}","gists_url":"https://api.github.com/users/zhaoyao91/gists{/gist_id}","starred_url":"https://api.github.com/users/zhaoyao91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhaoyao91/subscriptions","organizations_url":"https://api.github.com/users/zhaoyao91/orgs","repos_url":"https://api.github.com/users/zhaoyao91/repos","events_url":"https://api.github.com/users/zhaoyao91/events{/privacy}","received_events_url":"https://api.github.com/users/zhaoyao91/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-08T08:23:54Z","updated_at":"2015-11-08T10:50:57Z","closed_at":null,"body":"for test reason, I have such a model:\r\n\r\n    Items = new Mongo.Collection('items');\r\n    \r\n    Item = Astro.Class({\r\n        name: 'Item',\r\n        collection: Items,\r\n        fields: {\r\n            subItems: {\r\n                type: 'array',\r\n                nested: {\r\n                    name: 'SubItem',\r\n                    fields: {\r\n                        subItems: {\r\n                            type: 'array',\r\n                            nested: {\r\n                                name: 'SubSubItem',\r\n                                fields: {\r\n                                    images: {type: 'array', nested: 'string', default(){return []}},\r\n                                    image: {type: 'string'}\r\n                                }\r\n                            }\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    });\r\n\r\nwhile I can insert correctly: `Item.insert({subItems:[{subItems:[{images:['1']}]}]})`\r\n![image](https://cloud.githubusercontent.com/assets/3808838/11019450/b3339d5c-8634-11e5-8e25-a3e1bf86795b.png)\r\n\r\nI can't update it correctlly: `Item.update('hFM2u6vBdt2r9qbc3', {$set:{subItems:[{subItems:[{images:['2']}]}]\r\n}})`\r\n![image](https://cloud.githubusercontent.com/assets/3808838/11019452/d5b8d360-8634-11e5-9b1e-4b74f78e2ce0.png)\r\n"},"comment":{"url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/comments/154803445","html_url":"https://github.com/jagi/meteor-astronomy/issues/181#issuecomment-154803445","issue_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/181","id":154803445,"user":{"login":"jagi","id":1051229,"avatar_url":"https://avatars.githubusercontent.com/u/1051229?v=3","gravatar_id":"","url":"https://api.github.com/users/jagi","html_url":"https://github.com/jagi","followers_url":"https://api.github.com/users/jagi/followers","following_url":"https://api.github.com/users/jagi/following{/other_user}","gists_url":"https://api.github.com/users/jagi/gists{/gist_id}","starred_url":"https://api.github.com/users/jagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jagi/subscriptions","organizations_url":"https://api.github.com/users/jagi/orgs","repos_url":"https://api.github.com/users/jagi/repos","events_url":"https://api.github.com/users/jagi/events{/privacy}","received_events_url":"https://api.github.com/users/jagi/received_events","type":"User","site_admin":false},"created_at":"2015-11-08T10:50:57Z","updated_at":"2015-11-08T10:50:57Z","body":"You have to have an error somewhere in your code. Create a reproduction. If I use the following code, it works:\r\n\r\n```js\r\nItems = new Mongo.Collection(null);\r\n\r\nItem = Astro.Class({\r\n    name: 'Item',\r\n    collection: Items,\r\n    fields: {\r\n        subItems: {\r\n            type: 'array',\r\n            nested: {\r\n                name: 'SubItem',\r\n                fields: {\r\n                    subItems: {\r\n                        type: 'array',\r\n                        nested: {\r\n                            name: 'SubSubItem',\r\n                            fields: {\r\n                                images: {type: 'array', nested: 'string', default(){return []}},\r\n                                image: {type: 'string'}\r\n                            }\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    }\r\n});\r\n\r\nItem.insert({subItems:[{subItems:[{images:[1]}]}]});\r\nvar item = Item.findOne();\r\nItem.update(item._id, {subItems:[{subItems:[{images:[2]}]}]});\r\n```"}}