{"action":"created","comment":{"url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/comments/44468486","id":44468486,"diff_hunk":"@@ -244,7 +244,8 @@ TEST_CASE(\"Collection\", \"[collection]\") {\n             REQUIRE(skip == skip);\n             REQUIRE(limit == limit);\n             REQUIRE(batch_size == batch_size);\n-            REQUIRE(bson_get_data(query) == doc.data());\n+            bsoncxx::document::view query_view{bson_get_data(query), query->len};","path":"src/mongocxx/test/collection_mocked.cpp","position":5,"original_position":5,"commit_id":"9a54426f9daf74bff2a00f842c78f19b930b9ab3","original_commit_id":"9a54426f9daf74bff2a00f842c78f19b930b9ab3","user":{"login":"Machyne","id":2737181,"avatar_url":"https://avatars.githubusercontent.com/u/2737181?v=3","gravatar_id":"","url":"https://api.github.com/users/Machyne","html_url":"https://github.com/Machyne","followers_url":"https://api.github.com/users/Machyne/followers","following_url":"https://api.github.com/users/Machyne/following{/other_user}","gists_url":"https://api.github.com/users/Machyne/gists{/gist_id}","starred_url":"https://api.github.com/users/Machyne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Machyne/subscriptions","organizations_url":"https://api.github.com/users/Machyne/orgs","repos_url":"https://api.github.com/users/Machyne/repos","events_url":"https://api.github.com/users/Machyne/events{/privacy}","received_events_url":"https://api.github.com/users/Machyne/received_events","type":"User","site_admin":false},"body":"For simplicity, we now send all finds with the `{$query: {}}` form. Previously we would simply send the match document when we didn't have modifiers to the find. This test assumed that we would never send finds with the $query syntax, and would have broken had we ever tested sorts (which this PR implements) or modifiers.\r\n\r\nSince we _always_ use the $query form now, this new assumption is safe (and works when testing sorts). I will add a test to the mock as well to ensure this stays functioning.","created_at":"2015-11-10T21:34:54Z","updated_at":"2015-11-10T21:34:54Z","html_url":"https://github.com/mongodb/mongo-cxx-driver/pull/364#discussion_r44468486","pull_request_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/364","_links":{"self":{"href":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/comments/44468486"},"html":{"href":"https://github.com/mongodb/mongo-cxx-driver/pull/364#discussion_r44468486"},"pull_request":{"href":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/364"}}},"pull_request":{"url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/364","id":49469134,"html_url":"https://github.com/mongodb/mongo-cxx-driver/pull/364","diff_url":"https://github.com/mongodb/mongo-cxx-driver/pull/364.diff","patch_url":"https://github.com/mongodb/mongo-cxx-driver/pull/364.patch","issue_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/issues/364","number":364,"state":"open","locked":false,"title":"CXX-723: make find actually use sort","user":{"login":"Machyne","id":2737181,"avatar_url":"https://avatars.githubusercontent.com/u/2737181?v=3","gravatar_id":"","url":"https://api.github.com/users/Machyne","html_url":"https://github.com/Machyne","followers_url":"https://api.github.com/users/Machyne/followers","following_url":"https://api.github.com/users/Machyne/following{/other_user}","gists_url":"https://api.github.com/users/Machyne/gists{/gist_id}","starred_url":"https://api.github.com/users/Machyne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Machyne/subscriptions","organizations_url":"https://api.github.com/users/Machyne/orgs","repos_url":"https://api.github.com/users/Machyne/repos","events_url":"https://api.github.com/users/Machyne/events{/privacy}","received_events_url":"https://api.github.com/users/Machyne/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-02T18:45:29Z","updated_at":"2015-11-10T21:34:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2d8bdbb26b57330df631aebfae7ff4092041048c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/364/commits","review_comments_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/364/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/364/comments","statuses_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/statuses/9a54426f9daf74bff2a00f842c78f19b930b9ab3","head":{"label":"Machyne:CXX-723","ref":"CXX-723","sha":"9a54426f9daf74bff2a00f842c78f19b930b9ab3","user":{"login":"Machyne","id":2737181,"avatar_url":"https://avatars.githubusercontent.com/u/2737181?v=3","gravatar_id":"","url":"https://api.github.com/users/Machyne","html_url":"https://github.com/Machyne","followers_url":"https://api.github.com/users/Machyne/followers","following_url":"https://api.github.com/users/Machyne/following{/other_user}","gists_url":"https://api.github.com/users/Machyne/gists{/gist_id}","starred_url":"https://api.github.com/users/Machyne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Machyne/subscriptions","organizations_url":"https://api.github.com/users/Machyne/orgs","repos_url":"https://api.github.com/users/Machyne/repos","events_url":"https://api.github.com/users/Machyne/events{/privacy}","received_events_url":"https://api.github.com/users/Machyne/received_events","type":"User","site_admin":false},"repo":{"id":44116438,"name":"mongo-cxx-driver","full_name":"Machyne/mongo-cxx-driver","owner":{"login":"Machyne","id":2737181,"avatar_url":"https://avatars.githubusercontent.com/u/2737181?v=3","gravatar_id":"","url":"https://api.github.com/users/Machyne","html_url":"https://github.com/Machyne","followers_url":"https://api.github.com/users/Machyne/followers","following_url":"https://api.github.com/users/Machyne/following{/other_user}","gists_url":"https://api.github.com/users/Machyne/gists{/gist_id}","starred_url":"https://api.github.com/users/Machyne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Machyne/subscriptions","organizations_url":"https://api.github.com/users/Machyne/orgs","repos_url":"https://api.github.com/users/Machyne/repos","events_url":"https://api.github.com/users/Machyne/events{/privacy}","received_events_url":"https://api.github.com/users/Machyne/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Machyne/mongo-cxx-driver","description":"C++ Driver for MongoDB","fork":true,"url":"https://api.github.com/repos/Machyne/mongo-cxx-driver","forks_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/forks","keys_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/teams","hooks_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/hooks","issue_events_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/issues/events{/number}","events_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/events","assignees_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/assignees{/user}","branches_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/branches{/branch}","tags_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/tags","blobs_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/languages","stargazers_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/stargazers","contributors_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/contributors","subscribers_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/subscribers","subscription_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/subscription","commits_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/contents/{+path}","compare_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/merges","archive_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/downloads","issues_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/issues{/number}","pulls_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/labels{/name}","releases_url":"https://api.github.com/repos/Machyne/mongo-cxx-driver/releases{/id}","created_at":"2015-10-12T15:29:36Z","updated_at":"2015-10-12T15:29:38Z","pushed_at":"2015-11-10T21:24:43Z","git_url":"git://github.com/Machyne/mongo-cxx-driver.git","ssh_url":"git@github.com:Machyne/mongo-cxx-driver.git","clone_url":"https://github.com/Machyne/mongo-cxx-driver.git","svn_url":"https://github.com/Machyne/mongo-cxx-driver","homepage":null,"size":5822,"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":"7161b90737bfb99e7fa4f2b49c23eaf3b2769522","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-11-04T12:53:13Z","pushed_at":"2015-11-10T21:24:40Z","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":12331,"stargazers_count":197,"watchers_count":197,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":184,"mirror_url":null,"open_issues_count":13,"forks":184,"open_issues":13,"watchers":197,"default_branch":"legacy"}},"_links":{"self":{"href":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/364"},"html":{"href":"https://github.com/mongodb/mongo-cxx-driver/pull/364"},"issue":{"href":"https://api.github.com/repos/mongodb/mongo-cxx-driver/issues/364"},"comments":{"href":"https://api.github.com/repos/mongodb/mongo-cxx-driver/issues/364/comments"},"review_comments":{"href":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/364/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/364/commits"},"statuses":{"href":"https://api.github.com/repos/mongodb/mongo-cxx-driver/statuses/9a54426f9daf74bff2a00f842c78f19b930b9ab3"}}}}