{"action":"created","issue":{"url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/432","repository_url":"https://api.github.com/repos/jagi/meteor-astronomy","labels_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/432/labels{/name}","comments_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/432/comments","events_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/432/events","html_url":"https://github.com/jagi/meteor-astronomy/issues/432","id":163266094,"number":432,"title":"Field not updating","user":{"login":"dnish","id":7636313,"avatar_url":"https://avatars.githubusercontent.com/u/7636313?v=3","gravatar_id":"","url":"https://api.github.com/users/dnish","html_url":"https://github.com/dnish","followers_url":"https://api.github.com/users/dnish/followers","following_url":"https://api.github.com/users/dnish/following{/other_user}","gists_url":"https://api.github.com/users/dnish/gists{/gist_id}","starred_url":"https://api.github.com/users/dnish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnish/subscriptions","organizations_url":"https://api.github.com/users/dnish/orgs","repos_url":"https://api.github.com/users/dnish/repos","events_url":"https://api.github.com/users/dnish/events{/privacy}","received_events_url":"https://api.github.com/users/dnish/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-06-30T21:01:11Z","updated_at":"2016-07-01T10:23:25Z","closed_at":"2016-07-01T10:23:25Z","body":"Hey,\r\nmaybe it's too late, but I can't find the reason why my field \"updatedAt\" isn't updated. This is my schema:\r\n\r\n```\r\nChats = new Meteor.Collection(\"chats\");\r\n\r\nChat = Class.create({\r\n    name: 'Chat',\r\n    collection: Chats,\r\n    fields: {\r\n        user1: String,\r\n        user2: String,\r\n        user1Title:String,\r\n        user2Title:String,\r\n        createdAt: {\r\n            type: Date,\r\n            default: function() {\r\n                return new Date();\r\n            }\r\n        },\r\n        updatedAt: {\r\n            type: Date,\r\n            optional:true\r\n        },\r\n        \r\n    }\r\n});\r\n```\r\n\r\nOn the server, I'm doing something like this:\r\n\r\n```\r\nvar chat = Chat.findOne(doc.chatId);\r\nchat.updatedAt = new Date();\r\nchat.save();\r\n\r\n console.log(chat);\r\n```\r\n\r\nThe console output is showing me the correct id with the correct updatedAt value:\r\n\r\n```\r\n{ _id: 'kYNhnY3jHSgnvpvta',\r\nuser1: 'QrZKTkzGyhYyGFXd9',\r\nuser2: '47bG9Tb9PXvXAXGnK',\r\nuser1Title: 'Hase',\r\nuser2Title: 'Dennis',\r\ncreatedAt: Tue Jun 28 2016 15:55:01 GMT+0200 (CEST),\r\nupdatedAt: Thu Jun 30 2016 22:56:18 GMT+0200 (CEST) }\r\n``` \r\n\r\n\r\nThe problem: The value isn't saved on the database server. It is still showing the first date that was saved within updatedAt. The validation error object is undefined, so I guess this isn't a validation issue.\r\n\r\n\r\n//Edit:\r\n\r\nIt works if I define another different value, f.e. user2Title:\r\n\r\n```\r\nchat.updatedAt = new Date();\r\nchat.user2Title = \"DennisX\";\r\nchat.save();\r\n````\r\n\r\nBut this only works once. To make it work again, I need to set another user2Title again (and so on...)."},"comment":{"url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/comments/229912967","html_url":"https://github.com/jagi/meteor-astronomy/issues/432#issuecomment-229912967","issue_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/432","id":229912967,"user":{"login":"dnish","id":7636313,"avatar_url":"https://avatars.githubusercontent.com/u/7636313?v=3","gravatar_id":"","url":"https://api.github.com/users/dnish","html_url":"https://github.com/dnish","followers_url":"https://api.github.com/users/dnish/followers","following_url":"https://api.github.com/users/dnish/following{/other_user}","gists_url":"https://api.github.com/users/dnish/gists{/gist_id}","starred_url":"https://api.github.com/users/dnish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnish/subscriptions","organizations_url":"https://api.github.com/users/dnish/orgs","repos_url":"https://api.github.com/users/dnish/repos","events_url":"https://api.github.com/users/dnish/events{/privacy}","received_events_url":"https://api.github.com/users/dnish/received_events","type":"User","site_admin":false},"created_at":"2016-07-01T10:23:24Z","updated_at":"2016-07-01T10:23:24Z","body":"Works fine after upgrading from 2.0.1 to 2.1.0 "}}
{"actor":{"display_login":"dnish"}}