{"action":"created","issue":{"url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/96","labels_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/96/comments","events_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/96/events","html_url":"https://github.com/jagi/meteor-astronomy/issues/96","id":106521221,"number":96,"title":"_type for parent is always Child _type","user":{"login":"matikucharski","id":4822476,"avatar_url":"https://avatars.githubusercontent.com/u/4822476?v=3","gravatar_id":"","url":"https://api.github.com/users/matikucharski","html_url":"https://github.com/matikucharski","followers_url":"https://api.github.com/users/matikucharski/followers","following_url":"https://api.github.com/users/matikucharski/following{/other_user}","gists_url":"https://api.github.com/users/matikucharski/gists{/gist_id}","starred_url":"https://api.github.com/users/matikucharski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matikucharski/subscriptions","organizations_url":"https://api.github.com/users/matikucharski/orgs","repos_url":"https://api.github.com/users/matikucharski/repos","events_url":"https://api.github.com/users/matikucharski/events{/privacy}","received_events_url":"https://api.github.com/users/matikucharski/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-15T09:47:12Z","updated_at":"2015-09-15T12:25:32Z","closed_at":null,"body":"It looks like your `getDefaultValue` method in /lib/modules/fields/utils.js returns child _type if document itself don't have one.\r\nIn my case I have several documents in `Documents` collection some of them are Parents some of them were created as Children. But when I do `Documents.find().fetch()` all documents have `_type: 'Children'`"},"comment":{"url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/comments/140372167","html_url":"https://github.com/jagi/meteor-astronomy/issues/96#issuecomment-140372167","issue_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/96","id":140372167,"user":{"login":"matikucharski","id":4822476,"avatar_url":"https://avatars.githubusercontent.com/u/4822476?v=3","gravatar_id":"","url":"https://api.github.com/users/matikucharski","html_url":"https://github.com/matikucharski","followers_url":"https://api.github.com/users/matikucharski/followers","following_url":"https://api.github.com/users/matikucharski/following{/other_user}","gists_url":"https://api.github.com/users/matikucharski/gists{/gist_id}","starred_url":"https://api.github.com/users/matikucharski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matikucharski/subscriptions","organizations_url":"https://api.github.com/users/matikucharski/orgs","repos_url":"https://api.github.com/users/matikucharski/repos","events_url":"https://api.github.com/users/matikucharski/events{/privacy}","received_events_url":"https://api.github.com/users/matikucharski/received_events","type":"User","site_admin":false},"created_at":"2015-09-15T12:25:32Z","updated_at":"2015-09-15T12:25:32Z","body":"How do you know if fetched document should be parent or child type?\r\nI can see you have \r\n```\r\nif (schemaDefinition.transform) {\r\n      this.collection._transform = LocalCollection.wrapTransform(\r\n        Astro.utils.class.transform(this.className)\r\n      );\r\n}\r\n```\r\nin schema.js.\r\nBut it looks like if Parent and Child shares the same collection the last one transform function is added permanently for collection that is shared by those two classes"}}