{"action":"created","comment":{"url":"https://api.github.com/repos/firebase/firebase-ios-sdk/pulls/comments/183158660","pull_request_review_id":114112442,"id":183158660,"diff_hunk":"@@ -151,6 +151,53 @@ - (void)testMatchesPrimitiveValuesForFilters {\n   XCTAssertFalse([query2 matchesDocument:doc6]);\n }\n \n+- (void)testArrayContainsFilter {\n+  FSTQuery *query = [FSTTestQuery(\"collection\")\n+      queryByAddingFilter:FSTTestFilter(\"array\", @\"array_contains\", @42)];\n+\n+  // not an array.\n+  FSTDocument *doc = FSTTestDoc(\"collection/1\", 0, @{ @\"array\" : @1 }, NO);\n+  XCTAssertFalse([query matchesDocument:doc]);\n+\n+  // empty array.\n+  doc = FSTTestDoc(\"collection/1\", 0, @{ @\"array\" : @[] }, NO);\n+  XCTAssertFalse([query matchesDocument:doc]);\n+\n+  // array without element (and make sure it doesn't match in a nested field or a different field).\n+  doc = FSTTestDoc(\n+      \"collection/1\", 0,\n+      @{ @\"array\" : @[ @41, @\"42\",\n+                       @{ @\"a\" : @42,\n+                          @\"b\" : @[ @42 ] } ],\n+         @\"different\" : @[ @42 ] },\n+      NO);\n+  XCTAssertFalse([query matchesDocument:doc]);\n+\n+  // array with element.\n+  doc = FSTTestDoc(\"collection/1\", 0, @{ @\"array\" : @[ @1, @\"2\", @42, @{ @\"a\" : @1 } ] }, NO);\n+  XCTAssertTrue([query matchesDocument:doc]);\n+}\n+\n+- (void)testArrayContainsFilterWithObjectValue {\n+  // Search for arrays containing the object { a: [42] }\n+  FSTQuery *query =\n+      [FSTTestQuery(\"collection\") queryByAddingFilter:FSTTestFilter(\"array\", @\"array_contains\",\n+                                                                    @{ @\"a\" : @[ @42 ] })];\n+\n+  // array without element.\n+  FSTDocument *doc = FSTTestDoc(\"collection/1\", 0,","path":"Firestore/Example/Tests/Core/FSTQueryTests.mm","position":38,"original_position":38,"commit_id":"9e9292ccf85d8f01d4e36e55236ef7c872ed54c6","original_commit_id":"9e9292ccf85d8f01d4e36e55236ef7c872ed54c6","user":{"login":"wilhuff","id":10249104,"avatar_url":"https://avatars1.githubusercontent.com/u/10249104?v=4","gravatar_id":"","url":"https://api.github.com/users/wilhuff","html_url":"https://github.com/wilhuff","followers_url":"https://api.github.com/users/wilhuff/followers","following_url":"https://api.github.com/users/wilhuff/following{/other_user}","gists_url":"https://api.github.com/users/wilhuff/gists{/gist_id}","starred_url":"https://api.github.com/users/wilhuff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilhuff/subscriptions","organizations_url":"https://api.github.com/users/wilhuff/orgs","repos_url":"https://api.github.com/users/wilhuff/repos","events_url":"https://api.github.com/users/wilhuff/events{/privacy}","received_events_url":"https://api.github.com/users/wilhuff/received_events","type":"User","site_admin":false},"body":"Is it also worth testing that `@\"a\" : @[ @42, @43 ]` doesn't match?","created_at":"2018-04-20T20:16:18Z","updated_at":"2018-04-20T20:26:36Z","html_url":"https://github.com/firebase/firebase-ios-sdk/pull/1138#discussion_r183158660","pull_request_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/pulls/1138","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/firebase/firebase-ios-sdk/pulls/comments/183158660"},"html":{"href":"https://github.com/firebase/firebase-ios-sdk/pull/1138#discussion_r183158660"},"pull_request":{"href":"https://api.github.com/repos/firebase/firebase-ios-sdk/pulls/1138"}}},"pull_request":{"url":"https://api.github.com/repos/firebase/firebase-ios-sdk/pulls/1138","id":182608869,"html_url":"https://github.com/firebase/firebase-ios-sdk/pull/1138","diff_url":"https://github.com/firebase/firebase-ios-sdk/pull/1138.diff","patch_url":"https://github.com/firebase/firebase-ios-sdk/pull/1138.patch","issue_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/issues/1138","number":1138,"state":"open","locked":false,"title":"Array Contains Queries (not added to public headers yet).","user":{"login":"mikelehen","id":206364,"avatar_url":"https://avatars1.githubusercontent.com/u/206364?v=4","gravatar_id":"","url":"https://api.github.com/users/mikelehen","html_url":"https://github.com/mikelehen","followers_url":"https://api.github.com/users/mikelehen/followers","following_url":"https://api.github.com/users/mikelehen/following{/other_user}","gists_url":"https://api.github.com/users/mikelehen/gists{/gist_id}","starred_url":"https://api.github.com/users/mikelehen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikelehen/subscriptions","organizations_url":"https://api.github.com/users/mikelehen/orgs","repos_url":"https://api.github.com/users/mikelehen/repos","events_url":"https://api.github.com/users/mikelehen/events{/privacy}","received_events_url":"https://api.github.com/users/mikelehen/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-18T21:32:04Z","updated_at":"2018-04-20T20:26:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b190fea1a86636780921e2989b832bdd2ea96323","assignee":{"login":"wilhuff","id":10249104,"avatar_url":"https://avatars1.githubusercontent.com/u/10249104?v=4","gravatar_id":"","url":"https://api.github.com/users/wilhuff","html_url":"https://github.com/wilhuff","followers_url":"https://api.github.com/users/wilhuff/followers","following_url":"https://api.github.com/users/wilhuff/following{/other_user}","gists_url":"https://api.github.com/users/wilhuff/gists{/gist_id}","starred_url":"https://api.github.com/users/wilhuff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilhuff/subscriptions","organizations_url":"https://api.github.com/users/wilhuff/orgs","repos_url":"https://api.github.com/users/wilhuff/repos","events_url":"https://api.github.com/users/wilhuff/events{/privacy}","received_events_url":"https://api.github.com/users/wilhuff/received_events","type":"User","site_admin":false},"assignees":[{"login":"wilhuff","id":10249104,"avatar_url":"https://avatars1.githubusercontent.com/u/10249104?v=4","gravatar_id":"","url":"https://api.github.com/users/wilhuff","html_url":"https://github.com/wilhuff","followers_url":"https://api.github.com/users/wilhuff/followers","following_url":"https://api.github.com/users/wilhuff/following{/other_user}","gists_url":"https://api.github.com/users/wilhuff/gists{/gist_id}","starred_url":"https://api.github.com/users/wilhuff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilhuff/subscriptions","organizations_url":"https://api.github.com/users/wilhuff/orgs","repos_url":"https://api.github.com/users/wilhuff/repos","events_url":"https://api.github.com/users/wilhuff/events{/privacy}","received_events_url":"https://api.github.com/users/wilhuff/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":713434153,"url":"https://api.github.com/repos/firebase/firebase-ios-sdk/labels/Firestore","name":"Firestore","color":"c5def5","default":false},{"id":658858759,"url":"https://api.github.com/repos/firebase/firebase-ios-sdk/labels/cla:%20yes","name":"cla: yes","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/pulls/1138/commits","review_comments_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/pulls/1138/comments","review_comment_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/issues/1138/comments","statuses_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/statuses/9e9292ccf85d8f01d4e36e55236ef7c872ed54c6","head":{"label":"firebase:mikelehen/array-contains-queries","ref":"mikelehen/array-contains-queries","sha":"9e9292ccf85d8f01d4e36e55236ef7c872ed54c6","user":{"login":"firebase","id":1335026,"avatar_url":"https://avatars2.githubusercontent.com/u/1335026?v=4","gravatar_id":"","url":"https://api.github.com/users/firebase","html_url":"https://github.com/firebase","followers_url":"https://api.github.com/users/firebase/followers","following_url":"https://api.github.com/users/firebase/following{/other_user}","gists_url":"https://api.github.com/users/firebase/gists{/gist_id}","starred_url":"https://api.github.com/users/firebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firebase/subscriptions","organizations_url":"https://api.github.com/users/firebase/orgs","repos_url":"https://api.github.com/users/firebase/repos","events_url":"https://api.github.com/users/firebase/events{/privacy}","received_events_url":"https://api.github.com/users/firebase/received_events","type":"Organization","site_admin":false},"repo":{"id":89033556,"name":"firebase-ios-sdk","full_name":"firebase/firebase-ios-sdk","owner":{"login":"firebase","id":1335026,"avatar_url":"https://avatars2.githubusercontent.com/u/1335026?v=4","gravatar_id":"","url":"https://api.github.com/users/firebase","html_url":"https://github.com/firebase","followers_url":"https://api.github.com/users/firebase/followers","following_url":"https://api.github.com/users/firebase/following{/other_user}","gists_url":"https://api.github.com/users/firebase/gists{/gist_id}","starred_url":"https://api.github.com/users/firebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firebase/subscriptions","organizations_url":"https://api.github.com/users/firebase/orgs","repos_url":"https://api.github.com/users/firebase/repos","events_url":"https://api.github.com/users/firebase/events{/privacy}","received_events_url":"https://api.github.com/users/firebase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/firebase/firebase-ios-sdk","description":"Firebase iOS SDK","fork":false,"url":"https://api.github.com/repos/firebase/firebase-ios-sdk","forks_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/forks","keys_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/teams","hooks_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/hooks","issue_events_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/events","assignees_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/tags","blobs_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/languages","stargazers_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/stargazers","contributors_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/contributors","subscribers_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/subscribers","subscription_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/subscription","commits_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/merges","archive_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/downloads","issues_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/labels{/name}","releases_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/deployments","created_at":"2017-04-22T00:26:50Z","updated_at":"2018-04-20T20:18:41Z","pushed_at":"2018-04-20T20:24:13Z","git_url":"git://github.com/firebase/firebase-ios-sdk.git","ssh_url":"git@github.com:firebase/firebase-ios-sdk.git","clone_url":"https://github.com/firebase/firebase-ios-sdk.git","svn_url":"https://github.com/firebase/firebase-ios-sdk","homepage":"https://firebase.google.com","size":7429,"stargazers_count":653,"watchers_count":653,"language":"Objective-C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":126,"mirror_url":null,"archived":false,"open_issues_count":73,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":126,"open_issues":73,"watchers":653,"default_branch":"master"}},"base":{"label":"firebase:master","ref":"master","sha":"5d3c76f54397735473f13cf67a9b407244277bcc","user":{"login":"firebase","id":1335026,"avatar_url":"https://avatars2.githubusercontent.com/u/1335026?v=4","gravatar_id":"","url":"https://api.github.com/users/firebase","html_url":"https://github.com/firebase","followers_url":"https://api.github.com/users/firebase/followers","following_url":"https://api.github.com/users/firebase/following{/other_user}","gists_url":"https://api.github.com/users/firebase/gists{/gist_id}","starred_url":"https://api.github.com/users/firebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firebase/subscriptions","organizations_url":"https://api.github.com/users/firebase/orgs","repos_url":"https://api.github.com/users/firebase/repos","events_url":"https://api.github.com/users/firebase/events{/privacy}","received_events_url":"https://api.github.com/users/firebase/received_events","type":"Organization","site_admin":false},"repo":{"id":89033556,"name":"firebase-ios-sdk","full_name":"firebase/firebase-ios-sdk","owner":{"login":"firebase","id":1335026,"avatar_url":"https://avatars2.githubusercontent.com/u/1335026?v=4","gravatar_id":"","url":"https://api.github.com/users/firebase","html_url":"https://github.com/firebase","followers_url":"https://api.github.com/users/firebase/followers","following_url":"https://api.github.com/users/firebase/following{/other_user}","gists_url":"https://api.github.com/users/firebase/gists{/gist_id}","starred_url":"https://api.github.com/users/firebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firebase/subscriptions","organizations_url":"https://api.github.com/users/firebase/orgs","repos_url":"https://api.github.com/users/firebase/repos","events_url":"https://api.github.com/users/firebase/events{/privacy}","received_events_url":"https://api.github.com/users/firebase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/firebase/firebase-ios-sdk","description":"Firebase iOS SDK","fork":false,"url":"https://api.github.com/repos/firebase/firebase-ios-sdk","forks_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/forks","keys_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/teams","hooks_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/hooks","issue_events_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/events","assignees_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/tags","blobs_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/languages","stargazers_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/stargazers","contributors_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/contributors","subscribers_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/subscribers","subscription_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/subscription","commits_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/merges","archive_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/downloads","issues_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/labels{/name}","releases_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/deployments","created_at":"2017-04-22T00:26:50Z","updated_at":"2018-04-20T20:18:41Z","pushed_at":"2018-04-20T20:24:13Z","git_url":"git://github.com/firebase/firebase-ios-sdk.git","ssh_url":"git@github.com:firebase/firebase-ios-sdk.git","clone_url":"https://github.com/firebase/firebase-ios-sdk.git","svn_url":"https://github.com/firebase/firebase-ios-sdk","homepage":"https://firebase.google.com","size":7429,"stargazers_count":653,"watchers_count":653,"language":"Objective-C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":126,"mirror_url":null,"archived":false,"open_issues_count":73,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":126,"open_issues":73,"watchers":653,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/firebase/firebase-ios-sdk/pulls/1138"},"html":{"href":"https://github.com/firebase/firebase-ios-sdk/pull/1138"},"issue":{"href":"https://api.github.com/repos/firebase/firebase-ios-sdk/issues/1138"},"comments":{"href":"https://api.github.com/repos/firebase/firebase-ios-sdk/issues/1138/comments"},"review_comments":{"href":"https://api.github.com/repos/firebase/firebase-ios-sdk/pulls/1138/comments"},"review_comment":{"href":"https://api.github.com/repos/firebase/firebase-ios-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/firebase/firebase-ios-sdk/pulls/1138/commits"},"statuses":{"href":"https://api.github.com/repos/firebase/firebase-ios-sdk/statuses/9e9292ccf85d8f01d4e36e55236ef7c872ed54c6"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"wilhuff"}}