{"action":"opened","issue":{"url":"https://api.github.com/repos/matb33/meteor-collection-hooks/issues/168","labels_url":"https://api.github.com/repos/matb33/meteor-collection-hooks/issues/168/labels{/name}","comments_url":"https://api.github.com/repos/matb33/meteor-collection-hooks/issues/168/comments","events_url":"https://api.github.com/repos/matb33/meteor-collection-hooks/issues/168/events","html_url":"https://github.com/matb33/meteor-collection-hooks/issues/168","id":119828618,"number":168,"title":"How do we validate docs in an upsert?","user":{"login":"trusktr","id":297678,"avatar_url":"https://avatars.githubusercontent.com/u/297678?v=3","gravatar_id":"","url":"https://api.github.com/users/trusktr","html_url":"https://github.com/trusktr","followers_url":"https://api.github.com/users/trusktr/followers","following_url":"https://api.github.com/users/trusktr/following{/other_user}","gists_url":"https://api.github.com/users/trusktr/gists{/gist_id}","starred_url":"https://api.github.com/users/trusktr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trusktr/subscriptions","organizations_url":"https://api.github.com/users/trusktr/orgs","repos_url":"https://api.github.com/users/trusktr/repos","events_url":"https://api.github.com/users/trusktr/events{/privacy}","received_events_url":"https://api.github.com/users/trusktr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-01T23:02:51Z","updated_at":"2015-12-01T23:02:51Z","closed_at":null,"body":"I'm making my own custom validation logic (i.e. *not* using collection2, etc). I can easily validate documents on `.before.insert` and `.before.update` by checking the document, then simply returning false if validation fails.\r\n\r\nBut with `.before.upsert` the handler function doesn't have a `doc` arg. How might I be able to validate the documents added or the document inserted in an upsert?"}}