{"action":"created","comment":{"url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/comments/48994360","id":48994360,"diff_hunk":"@@ -43,12 +43,17 @@ std::int32_t bulk_write::upserted_count() const {\n     return view()[\"nUpserted\"].get_int32();\n }\n \n-bsoncxx::document::element bulk_write::inserted_ids() const {\n-    return view()[\"inserted_ids\"];\n-}\n+bulk_write::id_map bulk_write::upserted_ids() const {\n+\tid_map upserted_ids{};\n+\n+\tif (!view()[\"upserted\"]) {\n+\t\treturn upserted_ids;","path":"src/mongocxx/result/bulk_write.cpp","position":11,"original_position":11,"commit_id":"d96091da0029bf6a1c5404f12ce0893d2cd62acb","original_commit_id":"d96091da0029bf6a1c5404f12ce0893d2cd62acb","user":{"login":"acmorrow","id":268253,"avatar_url":"https://avatars.githubusercontent.com/u/268253?v=3","gravatar_id":"","url":"https://api.github.com/users/acmorrow","html_url":"https://github.com/acmorrow","followers_url":"https://api.github.com/users/acmorrow/followers","following_url":"https://api.github.com/users/acmorrow/following{/other_user}","gists_url":"https://api.github.com/users/acmorrow/gists{/gist_id}","starred_url":"https://api.github.com/users/acmorrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acmorrow/subscriptions","organizations_url":"https://api.github.com/users/acmorrow/orgs","repos_url":"https://api.github.com/users/acmorrow/repos","events_url":"https://api.github.com/users/acmorrow/events{/privacy}","received_events_url":"https://api.github.com/users/acmorrow/received_events","type":"User","site_admin":false},"body":"Actually, don't bother with clang-format now. We will do a sweep later","created_at":"2016-01-06T18:59:36Z","updated_at":"2016-01-06T18:59:36Z","html_url":"https://github.com/mongodb/mongo-cxx-driver/pull/420#discussion_r48994360","pull_request_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/420","_links":{"self":{"href":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/comments/48994360"},"html":{"href":"https://github.com/mongodb/mongo-cxx-driver/pull/420#discussion_r48994360"},"pull_request":{"href":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/420"}}},"pull_request":{"url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/420","id":55245908,"html_url":"https://github.com/mongodb/mongo-cxx-driver/pull/420","diff_url":"https://github.com/mongodb/mongo-cxx-driver/pull/420.diff","patch_url":"https://github.com/mongodb/mongo-cxx-driver/pull/420.patch","issue_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/issues/420","number":420,"state":"open","locked":false,"title":"CXX-798 - Fix result::bulk_write::upserted_ids and remove inserted_ids","user":{"login":"tessavitabile","id":13758212,"avatar_url":"https://avatars.githubusercontent.com/u/13758212?v=3","gravatar_id":"","url":"https://api.github.com/users/tessavitabile","html_url":"https://github.com/tessavitabile","followers_url":"https://api.github.com/users/tessavitabile/followers","following_url":"https://api.github.com/users/tessavitabile/following{/other_user}","gists_url":"https://api.github.com/users/tessavitabile/gists{/gist_id}","starred_url":"https://api.github.com/users/tessavitabile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tessavitabile/subscriptions","organizations_url":"https://api.github.com/users/tessavitabile/orgs","repos_url":"https://api.github.com/users/tessavitabile/repos","events_url":"https://api.github.com/users/tessavitabile/events{/privacy}","received_events_url":"https://api.github.com/users/tessavitabile/received_events","type":"User","site_admin":false},"body":"The C driver does not return the inserted IDs in bulk_write results, so we won't either. It is not required by the CRUD spec (https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst).\r\n\r\nI chose to have result::bulk_write::upserted_ids return a std::map<std::size_t, bsoncxx::document::element>, where the first element is the operation index in the bulk write, and the second is {\"_id\" : ...}. This is analogous to result::insert_many::inserted_ids.","created_at":"2016-01-06T18:24:29Z","updated_at":"2016-01-06T18:59:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b9327e8ad4315e8d9ad0fc7f41a790ac392ab90b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/420/commits","review_comments_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/420/comments","review_comment_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/issues/420/comments","statuses_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/statuses/d96091da0029bf6a1c5404f12ce0893d2cd62acb","head":{"label":"tessavitabile:CXX-798","ref":"CXX-798","sha":"d96091da0029bf6a1c5404f12ce0893d2cd62acb","user":{"login":"tessavitabile","id":13758212,"avatar_url":"https://avatars.githubusercontent.com/u/13758212?v=3","gravatar_id":"","url":"https://api.github.com/users/tessavitabile","html_url":"https://github.com/tessavitabile","followers_url":"https://api.github.com/users/tessavitabile/followers","following_url":"https://api.github.com/users/tessavitabile/following{/other_user}","gists_url":"https://api.github.com/users/tessavitabile/gists{/gist_id}","starred_url":"https://api.github.com/users/tessavitabile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tessavitabile/subscriptions","organizations_url":"https://api.github.com/users/tessavitabile/orgs","repos_url":"https://api.github.com/users/tessavitabile/repos","events_url":"https://api.github.com/users/tessavitabile/events{/privacy}","received_events_url":"https://api.github.com/users/tessavitabile/received_events","type":"User","site_admin":false},"repo":{"id":47144354,"name":"mongo-cxx-driver","full_name":"tessavitabile/mongo-cxx-driver","owner":{"login":"tessavitabile","id":13758212,"avatar_url":"https://avatars.githubusercontent.com/u/13758212?v=3","gravatar_id":"","url":"https://api.github.com/users/tessavitabile","html_url":"https://github.com/tessavitabile","followers_url":"https://api.github.com/users/tessavitabile/followers","following_url":"https://api.github.com/users/tessavitabile/following{/other_user}","gists_url":"https://api.github.com/users/tessavitabile/gists{/gist_id}","starred_url":"https://api.github.com/users/tessavitabile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tessavitabile/subscriptions","organizations_url":"https://api.github.com/users/tessavitabile/orgs","repos_url":"https://api.github.com/users/tessavitabile/repos","events_url":"https://api.github.com/users/tessavitabile/events{/privacy}","received_events_url":"https://api.github.com/users/tessavitabile/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tessavitabile/mongo-cxx-driver","description":"C++ Driver for MongoDB","fork":true,"url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver","forks_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/forks","keys_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/teams","hooks_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/hooks","issue_events_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/issues/events{/number}","events_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/events","assignees_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/assignees{/user}","branches_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/branches{/branch}","tags_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/tags","blobs_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/languages","stargazers_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/stargazers","contributors_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/contributors","subscribers_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/subscribers","subscription_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/subscription","commits_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/contents/{+path}","compare_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/merges","archive_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/downloads","issues_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/issues{/number}","pulls_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/labels{/name}","releases_url":"https://api.github.com/repos/tessavitabile/mongo-cxx-driver/releases{/id}","created_at":"2015-11-30T20:34:03Z","updated_at":"2015-11-30T20:34:05Z","pushed_at":"2016-01-06T18:15:33Z","git_url":"git://github.com/tessavitabile/mongo-cxx-driver.git","ssh_url":"git@github.com:tessavitabile/mongo-cxx-driver.git","clone_url":"https://github.com/tessavitabile/mongo-cxx-driver.git","svn_url":"https://github.com/tessavitabile/mongo-cxx-driver","homepage":null,"size":5912,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"legacy"}},"base":{"label":"mongodb:master","ref":"master","sha":"6559fe40dd1d8d8b6c841e5dc57bebda8e2f0636","user":{"login":"mongodb","id":45120,"avatar_url":"https://avatars.githubusercontent.com/u/45120?v=3","gravatar_id":"","url":"https://api.github.com/users/mongodb","html_url":"https://github.com/mongodb","followers_url":"https://api.github.com/users/mongodb/followers","following_url":"https://api.github.com/users/mongodb/following{/other_user}","gists_url":"https://api.github.com/users/mongodb/gists{/gist_id}","starred_url":"https://api.github.com/users/mongodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mongodb/subscriptions","organizations_url":"https://api.github.com/users/mongodb/orgs","repos_url":"https://api.github.com/users/mongodb/repos","events_url":"https://api.github.com/users/mongodb/events{/privacy}","received_events_url":"https://api.github.com/users/mongodb/received_events","type":"Organization","site_admin":false},"repo":{"id":15881868,"name":"mongo-cxx-driver","full_name":"mongodb/mongo-cxx-driver","owner":{"login":"mongodb","id":45120,"avatar_url":"https://avatars.githubusercontent.com/u/45120?v=3","gravatar_id":"","url":"https://api.github.com/users/mongodb","html_url":"https://github.com/mongodb","followers_url":"https://api.github.com/users/mongodb/followers","following_url":"https://api.github.com/users/mongodb/following{/other_user}","gists_url":"https://api.github.com/users/mongodb/gists{/gist_id}","starred_url":"https://api.github.com/users/mongodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mongodb/subscriptions","organizations_url":"https://api.github.com/users/mongodb/orgs","repos_url":"https://api.github.com/users/mongodb/repos","events_url":"https://api.github.com/users/mongodb/events{/privacy}","received_events_url":"https://api.github.com/users/mongodb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mongodb/mongo-cxx-driver","description":"C++ Driver for MongoDB","fork":false,"url":"https://api.github.com/repos/mongodb/mongo-cxx-driver","forks_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/forks","keys_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/teams","hooks_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/hooks","issue_events_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/issues/events{/number}","events_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/events","assignees_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/assignees{/user}","branches_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/branches{/branch}","tags_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/tags","blobs_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/languages","stargazers_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/stargazers","contributors_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/contributors","subscribers_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/subscribers","subscription_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/subscription","commits_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/contents/{+path}","compare_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/merges","archive_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/downloads","issues_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/issues{/number}","pulls_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/labels{/name}","releases_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/releases{/id}","created_at":"2014-01-13T21:08:36Z","updated_at":"2015-12-30T22:54:07Z","pushed_at":"2016-01-06T18:52:09Z","git_url":"git://github.com/mongodb/mongo-cxx-driver.git","ssh_url":"git@github.com:mongodb/mongo-cxx-driver.git","clone_url":"https://github.com/mongodb/mongo-cxx-driver.git","svn_url":"https://github.com/mongodb/mongo-cxx-driver","homepage":null,"size":6886,"stargazers_count":218,"watchers_count":218,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":196,"mirror_url":null,"open_issues_count":8,"forks":196,"open_issues":8,"watchers":218,"default_branch":"legacy"}},"_links":{"self":{"href":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/420"},"html":{"href":"https://github.com/mongodb/mongo-cxx-driver/pull/420"},"issue":{"href":"https://api.github.com/repos/mongodb/mongo-cxx-driver/issues/420"},"comments":{"href":"https://api.github.com/repos/mongodb/mongo-cxx-driver/issues/420/comments"},"review_comments":{"href":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/420/comments"},"review_comment":{"href":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/420/commits"},"statuses":{"href":"https://api.github.com/repos/mongodb/mongo-cxx-driver/statuses/d96091da0029bf6a1c5404f12ce0893d2cd62acb"}}}}