{"action":"created","issue":{"url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/306","repository_url":"https://api.github.com/repos/jagi/meteor-astronomy","labels_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/306/labels{/name}","comments_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/306/comments","events_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/306/events","html_url":"https://github.com/jagi/meteor-astronomy/pull/306","id":141072440,"number":306,"title":"fix for cannot update x and x at the same time","user":{"login":"marbemac","id":847542,"avatar_url":"https://avatars.githubusercontent.com/u/847542?v=3","gravatar_id":"","url":"https://api.github.com/users/marbemac","html_url":"https://github.com/marbemac","followers_url":"https://api.github.com/users/marbemac/followers","following_url":"https://api.github.com/users/marbemac/following{/other_user}","gists_url":"https://api.github.com/users/marbemac/gists{/gist_id}","starred_url":"https://api.github.com/users/marbemac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marbemac/subscriptions","organizations_url":"https://api.github.com/users/marbemac/orgs","repos_url":"https://api.github.com/users/marbemac/repos","events_url":"https://api.github.com/users/marbemac/events{/privacy}","received_events_url":"https://api.github.com/users/marbemac/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2016-03-15T19:15:37Z","updated_at":"2016-03-17T17:38:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jagi/meteor-astronomy/pulls/306","html_url":"https://github.com/jagi/meteor-astronomy/pull/306","diff_url":"https://github.com/jagi/meteor-astronomy/pull/306.diff","patch_url":"https://github.com/jagi/meteor-astronomy/pull/306.patch"},"body":"If something is set then unset, or set to undefined, a modifier like this ends up being built:\r\n\r\n```js\r\n$set = { 'securitySchemes.oauth2.scopes': undefined }\r\n$unset = { 'securitySchemes.oauth2.scopes': '' }\r\n```\r\n\r\nWhich leads to this error:\r\n\r\n```\r\n\"Cannot update 'securitySchemes.oauth2.scopes' and 'securitySchemes.oauth2.scopes' at the same time\"\r\n```\r\n\r\nWether or not this fix covers all possible edge cases I'm not sure? Unfortunately I'm not yet familiar enough with the Astronomy internals - just getting into it!"},"comment":{"url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/comments/197991991","html_url":"https://github.com/jagi/meteor-astronomy/pull/306#issuecomment-197991991","issue_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/306","id":197991991,"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":"2016-03-17T17:38:09Z","updated_at":"2016-03-17T17:38:09Z","body":"You're using the `set` method to set values but it's not obligatory, so removing `undefined` values is not required and even not recommended. When you do it, it would behave differently in these two situations:\r\n```js\r\n// 1\r\ndoc.set('nested', {a: 'a', b: undefined});\r\n// 2\r\ndoc.nested = {a: 'a', b: undefined};\r\n```\r\nWe can't do a lot if it goes about nested Objects without schema and `undefined` values in them. I know that you are probably not using schema for nested object, so that's why I'm writing it."}}