{"action":"created","comment":{"url":"https://api.github.com/repos/mongodb/mongo-swift-driver/pulls/comments/234775149","pull_request_review_id":176479576,"id":234775149,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNDc3NTE0OQ==","diff_hunk":"@@ -31,7 +31,11 @@ extension MongoCollection {\n             return nil\n         }\n \n-        return InsertOneResult(insertedId: try document.getValue(for: \"_id\"))\n+        if let insertedId = try document.getValue(for: \"_id\") {","path":"Sources/MongoSwift/MongoCollection+Write.swift","position":5,"original_position":5,"commit_id":"bc7e10828776671aba9fce41bd57bde0b0877207","original_commit_id":"bc7e10828776671aba9fce41bd57bde0b0877207","user":{"login":"kmahar","id":5976377,"node_id":"MDQ6VXNlcjU5NzYzNzc=","avatar_url":"https://avatars0.githubusercontent.com/u/5976377?v=4","gravatar_id":"","url":"https://api.github.com/users/kmahar","html_url":"https://github.com/kmahar","followers_url":"https://api.github.com/users/kmahar/followers","following_url":"https://api.github.com/users/kmahar/following{/other_user}","gists_url":"https://api.github.com/users/kmahar/gists{/gist_id}","starred_url":"https://api.github.com/users/kmahar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmahar/subscriptions","organizations_url":"https://api.github.com/users/kmahar/orgs","repos_url":"https://api.github.com/users/kmahar/repos","events_url":"https://api.github.com/users/kmahar/events{/privacy}","received_events_url":"https://api.github.com/users/kmahar/received_events","type":"User","site_admin":false},"body":"nit: I think\r\n```swift\r\nguard let insertedId = ... else { \r\n   // throw \r\n}}\r\n\r\n return InsertOneResult(insertedId: insertedId)\r\n```\r\nis more swifty if we're gonna throw in the `else` ","created_at":"2018-11-19T20:44:53Z","updated_at":"2018-11-19T20:56:55Z","html_url":"https://github.com/mongodb/mongo-swift-driver/pull/145#discussion_r234775149","pull_request_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/pulls/145","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/mongodb/mongo-swift-driver/pulls/comments/234775149"},"html":{"href":"https://github.com/mongodb/mongo-swift-driver/pull/145#discussion_r234775149"},"pull_request":{"href":"https://api.github.com/repos/mongodb/mongo-swift-driver/pulls/145"}}},"pull_request":{"url":"https://api.github.com/repos/mongodb/mongo-swift-driver/pulls/145","id":232086639,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyMDg2NjM5","html_url":"https://github.com/mongodb/mongo-swift-driver/pull/145","diff_url":"https://github.com/mongodb/mongo-swift-driver/pull/145.diff","patch_url":"https://github.com/mongodb/mongo-swift-driver/pull/145.patch","issue_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/issues/145","number":145,"state":"open","locked":false,"title":"SWIFT-193: Improve handling of BSON nulls","user":{"login":"Utagai","id":10730394,"node_id":"MDQ6VXNlcjEwNzMwMzk0","avatar_url":"https://avatars2.githubusercontent.com/u/10730394?v=4","gravatar_id":"","url":"https://api.github.com/users/Utagai","html_url":"https://github.com/Utagai","followers_url":"https://api.github.com/users/Utagai/followers","following_url":"https://api.github.com/users/Utagai/following{/other_user}","gists_url":"https://api.github.com/users/Utagai/gists{/gist_id}","starred_url":"https://api.github.com/users/Utagai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Utagai/subscriptions","organizations_url":"https://api.github.com/users/Utagai/orgs","repos_url":"https://api.github.com/users/Utagai/repos","events_url":"https://api.github.com/users/Utagai/events{/privacy}","received_events_url":"https://api.github.com/users/Utagai/received_events","type":"User","site_admin":false},"body":"[SWIFT-193](https://jira.mongodb.org/browse/SWIFT-193)\r\n\r\nThis PR improves our handling of BSON nulls by introducing `NSNull` such that BSON nulls are represented by it, and missing values are Swift `nil`'s.\r\n\r\nThis PR is pretty big because it has widespread changes to the codebase for moving over to using `NSNull` in place of `nil` for BSON null values. There are _a lot_ of small little changes where we are able to migrate from using `BSONValue?` to `BSONValue`, as well as many changes where we use `NSNull` instead of `nil`. I believe they should all be fine, but would not be surprised whatsoever if a few are not, since there was often some ambiguity of what the past code meant when it had `nil` (was it a missing value? A BSON null value? Both?). This branch does however pass all the tests.\r\n\r\nAlso, I am now capable of typing `NSNull` in my sleep and have become a master of removing `?` at the end of `BSONValue?`.","created_at":"2018-11-19T19:30:07Z","updated_at":"2018-11-19T20:56:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f9f670ea22c0d3869d899848591e402d5fbd728","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jmikola","id":244663,"node_id":"MDQ6VXNlcjI0NDY2Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/244663?v=4","gravatar_id":"","url":"https://api.github.com/users/jmikola","html_url":"https://github.com/jmikola","followers_url":"https://api.github.com/users/jmikola/followers","following_url":"https://api.github.com/users/jmikola/following{/other_user}","gists_url":"https://api.github.com/users/jmikola/gists{/gist_id}","starred_url":"https://api.github.com/users/jmikola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmikola/subscriptions","organizations_url":"https://api.github.com/users/jmikola/orgs","repos_url":"https://api.github.com/users/jmikola/repos","events_url":"https://api.github.com/users/jmikola/events{/privacy}","received_events_url":"https://api.github.com/users/jmikola/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/pulls/145/commits","review_comments_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/pulls/145/comments","review_comment_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/issues/145/comments","statuses_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/statuses/bc7e10828776671aba9fce41bd57bde0b0877207","head":{"label":"Utagai:SWIFT-193","ref":"SWIFT-193","sha":"bc7e10828776671aba9fce41bd57bde0b0877207","user":{"login":"Utagai","id":10730394,"node_id":"MDQ6VXNlcjEwNzMwMzk0","avatar_url":"https://avatars2.githubusercontent.com/u/10730394?v=4","gravatar_id":"","url":"https://api.github.com/users/Utagai","html_url":"https://github.com/Utagai","followers_url":"https://api.github.com/users/Utagai/followers","following_url":"https://api.github.com/users/Utagai/following{/other_user}","gists_url":"https://api.github.com/users/Utagai/gists{/gist_id}","starred_url":"https://api.github.com/users/Utagai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Utagai/subscriptions","organizations_url":"https://api.github.com/users/Utagai/orgs","repos_url":"https://api.github.com/users/Utagai/repos","events_url":"https://api.github.com/users/Utagai/events{/privacy}","received_events_url":"https://api.github.com/users/Utagai/received_events","type":"User","site_admin":false},"repo":{"id":153830140,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM4MzAxNDA=","name":"mongo-swift-driver","full_name":"Utagai/mongo-swift-driver","private":false,"owner":{"login":"Utagai","id":10730394,"node_id":"MDQ6VXNlcjEwNzMwMzk0","avatar_url":"https://avatars2.githubusercontent.com/u/10730394?v=4","gravatar_id":"","url":"https://api.github.com/users/Utagai","html_url":"https://github.com/Utagai","followers_url":"https://api.github.com/users/Utagai/followers","following_url":"https://api.github.com/users/Utagai/following{/other_user}","gists_url":"https://api.github.com/users/Utagai/gists{/gist_id}","starred_url":"https://api.github.com/users/Utagai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Utagai/subscriptions","organizations_url":"https://api.github.com/users/Utagai/orgs","repos_url":"https://api.github.com/users/Utagai/repos","events_url":"https://api.github.com/users/Utagai/events{/privacy}","received_events_url":"https://api.github.com/users/Utagai/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Utagai/mongo-swift-driver","description":"The Swift driver for MongoDB","fork":true,"url":"https://api.github.com/repos/Utagai/mongo-swift-driver","forks_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/forks","keys_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/teams","hooks_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/hooks","issue_events_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/issues/events{/number}","events_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/events","assignees_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/assignees{/user}","branches_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/branches{/branch}","tags_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/tags","blobs_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/languages","stargazers_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/stargazers","contributors_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/contributors","subscribers_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/subscribers","subscription_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/subscription","commits_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/contents/{+path}","compare_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/merges","archive_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/downloads","issues_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/issues{/number}","pulls_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/labels{/name}","releases_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/releases{/id}","deployments_url":"https://api.github.com/repos/Utagai/mongo-swift-driver/deployments","created_at":"2018-10-19T19:12:02Z","updated_at":"2018-11-19T19:10:27Z","pushed_at":"2018-11-19T20:16:20Z","git_url":"git://github.com/Utagai/mongo-swift-driver.git","ssh_url":"git@github.com:Utagai/mongo-swift-driver.git","clone_url":"https://github.com/Utagai/mongo-swift-driver.git","svn_url":"https://github.com/Utagai/mongo-swift-driver","homepage":"","size":7729,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mongodb:master","ref":"master","sha":"546fd4a5eba9561ffe2b660a5e255fdb490067f7","user":{"login":"mongodb","id":45120,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MTIw","avatar_url":"https://avatars1.githubusercontent.com/u/45120?v=4","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":118030974,"node_id":"MDEwOlJlcG9zaXRvcnkxMTgwMzA5NzQ=","name":"mongo-swift-driver","full_name":"mongodb/mongo-swift-driver","private":false,"owner":{"login":"mongodb","id":45120,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MTIw","avatar_url":"https://avatars1.githubusercontent.com/u/45120?v=4","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},"html_url":"https://github.com/mongodb/mongo-swift-driver","description":"The Swift driver for MongoDB","fork":false,"url":"https://api.github.com/repos/mongodb/mongo-swift-driver","forks_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/forks","keys_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/teams","hooks_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/hooks","issue_events_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/issues/events{/number}","events_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/events","assignees_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/assignees{/user}","branches_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/branches{/branch}","tags_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/tags","blobs_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/languages","stargazers_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/stargazers","contributors_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/contributors","subscribers_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/subscribers","subscription_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/subscription","commits_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/contents/{+path}","compare_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/merges","archive_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/downloads","issues_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/issues{/number}","pulls_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/labels{/name}","releases_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/releases{/id}","deployments_url":"https://api.github.com/repos/mongodb/mongo-swift-driver/deployments","created_at":"2018-01-18T19:55:11Z","updated_at":"2018-11-19T19:40:03Z","pushed_at":"2018-11-19T20:16:21Z","git_url":"git://github.com/mongodb/mongo-swift-driver.git","ssh_url":"git@github.com:mongodb/mongo-swift-driver.git","clone_url":"https://github.com/mongodb/mongo-swift-driver.git","svn_url":"https://github.com/mongodb/mongo-swift-driver","homepage":"","size":7635,"stargazers_count":59,"watchers_count":59,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":9,"open_issues":6,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mongodb/mongo-swift-driver/pulls/145"},"html":{"href":"https://github.com/mongodb/mongo-swift-driver/pull/145"},"issue":{"href":"https://api.github.com/repos/mongodb/mongo-swift-driver/issues/145"},"comments":{"href":"https://api.github.com/repos/mongodb/mongo-swift-driver/issues/145/comments"},"review_comments":{"href":"https://api.github.com/repos/mongodb/mongo-swift-driver/pulls/145/comments"},"review_comment":{"href":"https://api.github.com/repos/mongodb/mongo-swift-driver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mongodb/mongo-swift-driver/pulls/145/commits"},"statuses":{"href":"https://api.github.com/repos/mongodb/mongo-swift-driver/statuses/bc7e10828776671aba9fce41bd57bde0b0877207"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"kmahar"}}