{"action":"created","comment":{"url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/pulls/comments/31890537","id":31890537,"diff_hunk":"@@ -308,8 +308,18 @@ class globals.Document\n \n       fieldsWalker @meta.fields\n \n-      referencesIncludeProjection = LocalCollection._compileProjection referencesInclude\n       referencesExcludeProjection = LocalCollection._compileProjection referencesExclude\n+      referencesIncludeModification = (document) ->\n+        # We can't use _compileProjection here as this would cause top-level fields to\n+        # be overwritten when updating subfields.\n+        result = {}\n+        for path, value of referencesInclude\n+          continue if value isnt 1\n+\n+          value = _.reduce path.split('.'), ((doc, atom) -> doc[atom]), document\n+          result[path] = value unless _.isUndefined value","path":"lib.coffee","position":14,"original_position":14,"commit_id":"78a07226fbd4a0e580ee68e5479084ca4f0c58b2","original_commit_id":"78a07226fbd4a0e580ee68e5479084ca4f0c58b2","user":{"login":"kostko","id":543739,"avatar_url":"https://avatars.githubusercontent.com/u/543739?v=3","gravatar_id":"","url":"https://api.github.com/users/kostko","html_url":"https://github.com/kostko","followers_url":"https://api.github.com/users/kostko/followers","following_url":"https://api.github.com/users/kostko/following{/other_user}","gists_url":"https://api.github.com/users/kostko/gists{/gist_id}","starred_url":"https://api.github.com/users/kostko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kostko/subscriptions","organizations_url":"https://api.github.com/users/kostko/orgs","repos_url":"https://api.github.com/users/kostko/repos","events_url":"https://api.github.com/users/kostko/events{/privacy}","received_events_url":"https://api.github.com/users/kostko/received_events","type":"User","site_admin":false},"body":"> I would add here an assert that result[path] does not yet exist. Otherwise it might be overridden.\r\n\r\nIt can't exist as we are iterating over keys of a dictionary, which are always unique? So no path will be used twice.","created_at":"2015-06-08T07:08:16Z","updated_at":"2015-06-08T07:08:16Z","html_url":"https://github.com/peerlibrary/meteor-peerdb/pull/33#discussion_r31890537","pull_request_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/peerlibrary/meteor-peerdb/pulls/comments/31890537"},"html":{"href":"https://github.com/peerlibrary/meteor-peerdb/pull/33#discussion_r31890537"},"pull_request":{"href":"https://api.github.com/repos/peerlibrary/meteor-peerdb/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/pulls/33","id":37113853,"html_url":"https://github.com/peerlibrary/meteor-peerdb/pull/33","diff_url":"https://github.com/peerlibrary/meteor-peerdb/pull/33.diff","patch_url":"https://github.com/peerlibrary/meteor-peerdb/pull/33.patch","issue_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/issues/33","number":33,"state":"closed","locked":false,"title":"Fixed handling of subfield references in bulk insert","user":{"login":"kostko","id":543739,"avatar_url":"https://avatars.githubusercontent.com/u/543739?v=3","gravatar_id":"","url":"https://api.github.com/users/kostko","html_url":"https://github.com/kostko","followers_url":"https://api.github.com/users/kostko/followers","following_url":"https://api.github.com/users/kostko/following{/other_user}","gists_url":"https://api.github.com/users/kostko/gists{/gist_id}","starred_url":"https://api.github.com/users/kostko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kostko/subscriptions","organizations_url":"https://api.github.com/users/kostko/orgs","repos_url":"https://api.github.com/users/kostko/repos","events_url":"https://api.github.com/users/kostko/events{/privacy}","received_events_url":"https://api.github.com/users/kostko/received_events","type":"User","site_admin":false},"body":"Fixes #32 ","created_at":"2015-06-07T21:36:10Z","updated_at":"2015-06-08T07:08:16Z","closed_at":"2015-06-07T22:51:20Z","merged_at":"2015-06-07T22:51:20Z","merge_commit_sha":"88dd8ec8422c9758b27ad13d104aa41070bb1a2f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/pulls/33/commits","review_comments_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/pulls/33/comments","review_comment_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/issues/33/comments","statuses_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/statuses/78a07226fbd4a0e580ee68e5479084ca4f0c58b2","head":{"label":"peerlibrary:fix-issue-32","ref":"fix-issue-32","sha":"78a07226fbd4a0e580ee68e5479084ca4f0c58b2","user":{"login":"peerlibrary","id":3861814,"avatar_url":"https://avatars.githubusercontent.com/u/3861814?v=3","gravatar_id":"","url":"https://api.github.com/users/peerlibrary","html_url":"https://github.com/peerlibrary","followers_url":"https://api.github.com/users/peerlibrary/followers","following_url":"https://api.github.com/users/peerlibrary/following{/other_user}","gists_url":"https://api.github.com/users/peerlibrary/gists{/gist_id}","starred_url":"https://api.github.com/users/peerlibrary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peerlibrary/subscriptions","organizations_url":"https://api.github.com/users/peerlibrary/orgs","repos_url":"https://api.github.com/users/peerlibrary/repos","events_url":"https://api.github.com/users/peerlibrary/events{/privacy}","received_events_url":"https://api.github.com/users/peerlibrary/received_events","type":"Organization","site_admin":false},"repo":{"id":13539049,"name":"meteor-peerdb","full_name":"peerlibrary/meteor-peerdb","owner":{"login":"peerlibrary","id":3861814,"avatar_url":"https://avatars.githubusercontent.com/u/3861814?v=3","gravatar_id":"","url":"https://api.github.com/users/peerlibrary","html_url":"https://github.com/peerlibrary","followers_url":"https://api.github.com/users/peerlibrary/followers","following_url":"https://api.github.com/users/peerlibrary/following{/other_user}","gists_url":"https://api.github.com/users/peerlibrary/gists{/gist_id}","starred_url":"https://api.github.com/users/peerlibrary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peerlibrary/subscriptions","organizations_url":"https://api.github.com/users/peerlibrary/orgs","repos_url":"https://api.github.com/users/peerlibrary/repos","events_url":"https://api.github.com/users/peerlibrary/events{/privacy}","received_events_url":"https://api.github.com/users/peerlibrary/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/peerlibrary/meteor-peerdb","description":"Reactive database layer with references, generators, triggers, migrations, etc.","fork":false,"url":"https://api.github.com/repos/peerlibrary/meteor-peerdb","forks_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/forks","keys_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/teams","hooks_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/hooks","issue_events_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/issues/events{/number}","events_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/events","assignees_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/assignees{/user}","branches_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/branches{/branch}","tags_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/tags","blobs_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/statuses/{sha}","languages_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/languages","stargazers_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/stargazers","contributors_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/contributors","subscribers_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/subscribers","subscription_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/subscription","commits_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/contents/{+path}","compare_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/merges","archive_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/downloads","issues_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/issues{/number}","pulls_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/pulls{/number}","milestones_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/milestones{/number}","notifications_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/labels{/name}","releases_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/releases{/id}","created_at":"2013-10-13T12:44:28Z","updated_at":"2015-05-31T00:16:55Z","pushed_at":"2015-06-07T22:51:25Z","git_url":"git://github.com/peerlibrary/meteor-peerdb.git","ssh_url":"git@github.com:peerlibrary/meteor-peerdb.git","clone_url":"https://github.com/peerlibrary/meteor-peerdb.git","svn_url":"https://github.com/peerlibrary/meteor-peerdb","homepage":"http://atmospherejs.com/peerlibrary/peerdb","size":1115,"stargazers_count":89,"watchers_count":89,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":12,"forks":9,"open_issues":12,"watchers":89,"default_branch":"master"}},"base":{"label":"peerlibrary:master","ref":"master","sha":"36594bba5756801c71dde8d63eefa2564223f059","user":{"login":"peerlibrary","id":3861814,"avatar_url":"https://avatars.githubusercontent.com/u/3861814?v=3","gravatar_id":"","url":"https://api.github.com/users/peerlibrary","html_url":"https://github.com/peerlibrary","followers_url":"https://api.github.com/users/peerlibrary/followers","following_url":"https://api.github.com/users/peerlibrary/following{/other_user}","gists_url":"https://api.github.com/users/peerlibrary/gists{/gist_id}","starred_url":"https://api.github.com/users/peerlibrary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peerlibrary/subscriptions","organizations_url":"https://api.github.com/users/peerlibrary/orgs","repos_url":"https://api.github.com/users/peerlibrary/repos","events_url":"https://api.github.com/users/peerlibrary/events{/privacy}","received_events_url":"https://api.github.com/users/peerlibrary/received_events","type":"Organization","site_admin":false},"repo":{"id":13539049,"name":"meteor-peerdb","full_name":"peerlibrary/meteor-peerdb","owner":{"login":"peerlibrary","id":3861814,"avatar_url":"https://avatars.githubusercontent.com/u/3861814?v=3","gravatar_id":"","url":"https://api.github.com/users/peerlibrary","html_url":"https://github.com/peerlibrary","followers_url":"https://api.github.com/users/peerlibrary/followers","following_url":"https://api.github.com/users/peerlibrary/following{/other_user}","gists_url":"https://api.github.com/users/peerlibrary/gists{/gist_id}","starred_url":"https://api.github.com/users/peerlibrary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peerlibrary/subscriptions","organizations_url":"https://api.github.com/users/peerlibrary/orgs","repos_url":"https://api.github.com/users/peerlibrary/repos","events_url":"https://api.github.com/users/peerlibrary/events{/privacy}","received_events_url":"https://api.github.com/users/peerlibrary/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/peerlibrary/meteor-peerdb","description":"Reactive database layer with references, generators, triggers, migrations, etc.","fork":false,"url":"https://api.github.com/repos/peerlibrary/meteor-peerdb","forks_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/forks","keys_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/teams","hooks_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/hooks","issue_events_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/issues/events{/number}","events_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/events","assignees_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/assignees{/user}","branches_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/branches{/branch}","tags_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/tags","blobs_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/statuses/{sha}","languages_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/languages","stargazers_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/stargazers","contributors_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/contributors","subscribers_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/subscribers","subscription_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/subscription","commits_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/contents/{+path}","compare_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/merges","archive_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/downloads","issues_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/issues{/number}","pulls_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/pulls{/number}","milestones_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/milestones{/number}","notifications_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/labels{/name}","releases_url":"https://api.github.com/repos/peerlibrary/meteor-peerdb/releases{/id}","created_at":"2013-10-13T12:44:28Z","updated_at":"2015-05-31T00:16:55Z","pushed_at":"2015-06-07T22:51:25Z","git_url":"git://github.com/peerlibrary/meteor-peerdb.git","ssh_url":"git@github.com:peerlibrary/meteor-peerdb.git","clone_url":"https://github.com/peerlibrary/meteor-peerdb.git","svn_url":"https://github.com/peerlibrary/meteor-peerdb","homepage":"http://atmospherejs.com/peerlibrary/peerdb","size":1115,"stargazers_count":89,"watchers_count":89,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":12,"forks":9,"open_issues":12,"watchers":89,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/peerlibrary/meteor-peerdb/pulls/33"},"html":{"href":"https://github.com/peerlibrary/meteor-peerdb/pull/33"},"issue":{"href":"https://api.github.com/repos/peerlibrary/meteor-peerdb/issues/33"},"comments":{"href":"https://api.github.com/repos/peerlibrary/meteor-peerdb/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/peerlibrary/meteor-peerdb/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/peerlibrary/meteor-peerdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/peerlibrary/meteor-peerdb/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/peerlibrary/meteor-peerdb/statuses/78a07226fbd4a0e580ee68e5479084ca4f0c58b2"}}}}