{"action":"created","comment":{"url":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/comments/57754761","id":57754761,"diff_hunk":"@@ -206,7 +206,9 @@ function matchesKeyConstraints(object, key, constraints) {\n         }\n         break;\n       case '$exists':\n-        if (typeof object[key] === 'undefined') {\n+        let propertyExists = typeof object[key] !== 'undefined';\n+        let existenceIsRequired = constraints['$exists'];","path":"src/LiveQuery/QueryTools.js","position":6,"original_position":6,"commit_id":"3dccd612225b46a9759f0f3c3ad79d240a2a0c24","original_commit_id":"3dccd612225b46a9759f0f3c3ad79d240a2a0c24","user":{"login":"andrecardoso","id":161674,"avatar_url":"https://avatars.githubusercontent.com/u/161674?v=3","gravatar_id":"","url":"https://api.github.com/users/andrecardoso","html_url":"https://github.com/andrecardoso","followers_url":"https://api.github.com/users/andrecardoso/followers","following_url":"https://api.github.com/users/andrecardoso/following{/other_user}","gists_url":"https://api.github.com/users/andrecardoso/gists{/gist_id}","starred_url":"https://api.github.com/users/andrecardoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrecardoso/subscriptions","organizations_url":"https://api.github.com/users/andrecardoso/orgs","repos_url":"https://api.github.com/users/andrecardoso/repos","events_url":"https://api.github.com/users/andrecardoso/events{/privacy}","received_events_url":"https://api.github.com/users/andrecardoso/received_events","type":"User","site_admin":false},"body":"From my tests and understanding it will always be a boolean, because this query representation is done by the SDKs. It could be something different when the query is done via REST but this is not the case for LiveQuery right? \r\n\r\nAnyway the logic would still work if `constraints['$exists']` is `null/undefined`.","created_at":"2016-03-29T16:31:44Z","updated_at":"2016-03-29T16:31:44Z","html_url":"https://github.com/ParsePlatform/parse-server/pull/1250#discussion_r57754761","pull_request_url":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/1250","_links":{"self":{"href":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/comments/57754761"},"html":{"href":"https://github.com/ParsePlatform/parse-server/pull/1250#discussion_r57754761"},"pull_request":{"href":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/1250"}}},"pull_request":{"url":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/1250","id":64474653,"html_url":"https://github.com/ParsePlatform/parse-server/pull/1250","diff_url":"https://github.com/ParsePlatform/parse-server/pull/1250.diff","patch_url":"https://github.com/ParsePlatform/parse-server/pull/1250.patch","issue_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/1250","number":1250,"state":"open","locked":false,"title":"Matching queries with doesNotExist constraint","user":{"login":"andrecardoso","id":161674,"avatar_url":"https://avatars.githubusercontent.com/u/161674?v=3","gravatar_id":"","url":"https://api.github.com/users/andrecardoso","html_url":"https://github.com/andrecardoso","followers_url":"https://api.github.com/users/andrecardoso/followers","following_url":"https://api.github.com/users/andrecardoso/following{/other_user}","gists_url":"https://api.github.com/users/andrecardoso/gists{/gist_id}","starred_url":"https://api.github.com/users/andrecardoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrecardoso/subscriptions","organizations_url":"https://api.github.com/users/andrecardoso/orgs","repos_url":"https://api.github.com/users/andrecardoso/repos","events_url":"https://api.github.com/users/andrecardoso/events{/privacy}","received_events_url":"https://api.github.com/users/andrecardoso/received_events","type":"User","site_admin":false},"body":"I was trying LiveQuery using a query with a doesNotExist constraint and after some time debugging I've found out that QueryTools wasn't matching it correctly.\r\n\r\nThis pull request resolves this issue.\r\n\r\nFeedback is appreciated. \r\n\r\nThanks.","created_at":"2016-03-29T14:30:08Z","updated_at":"2016-03-29T16:31:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da4cbd7a1da9c7af4b80937587112fdadf314a91","assignee":{"login":"flovilmart","id":364568,"avatar_url":"https://avatars.githubusercontent.com/u/364568?v=3","gravatar_id":"","url":"https://api.github.com/users/flovilmart","html_url":"https://github.com/flovilmart","followers_url":"https://api.github.com/users/flovilmart/followers","following_url":"https://api.github.com/users/flovilmart/following{/other_user}","gists_url":"https://api.github.com/users/flovilmart/gists{/gist_id}","starred_url":"https://api.github.com/users/flovilmart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flovilmart/subscriptions","organizations_url":"https://api.github.com/users/flovilmart/orgs","repos_url":"https://api.github.com/users/flovilmart/repos","events_url":"https://api.github.com/users/flovilmart/events{/privacy}","received_events_url":"https://api.github.com/users/flovilmart/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/1250/commits","review_comments_url":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/1250/comments","review_comment_url":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/1250/comments","statuses_url":"https://api.github.com/repos/ParsePlatform/parse-server/statuses/3dccd612225b46a9759f0f3c3ad79d240a2a0c24","head":{"label":"andrecardoso:live-query-server-matching-does-not-exist-queries","ref":"live-query-server-matching-does-not-exist-queries","sha":"3dccd612225b46a9759f0f3c3ad79d240a2a0c24","user":{"login":"andrecardoso","id":161674,"avatar_url":"https://avatars.githubusercontent.com/u/161674?v=3","gravatar_id":"","url":"https://api.github.com/users/andrecardoso","html_url":"https://github.com/andrecardoso","followers_url":"https://api.github.com/users/andrecardoso/followers","following_url":"https://api.github.com/users/andrecardoso/following{/other_user}","gists_url":"https://api.github.com/users/andrecardoso/gists{/gist_id}","starred_url":"https://api.github.com/users/andrecardoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrecardoso/subscriptions","organizations_url":"https://api.github.com/users/andrecardoso/orgs","repos_url":"https://api.github.com/users/andrecardoso/repos","events_url":"https://api.github.com/users/andrecardoso/events{/privacy}","received_events_url":"https://api.github.com/users/andrecardoso/received_events","type":"User","site_admin":false},"repo":{"id":54981436,"name":"parse-server","full_name":"andrecardoso/parse-server","owner":{"login":"andrecardoso","id":161674,"avatar_url":"https://avatars.githubusercontent.com/u/161674?v=3","gravatar_id":"","url":"https://api.github.com/users/andrecardoso","html_url":"https://github.com/andrecardoso","followers_url":"https://api.github.com/users/andrecardoso/followers","following_url":"https://api.github.com/users/andrecardoso/following{/other_user}","gists_url":"https://api.github.com/users/andrecardoso/gists{/gist_id}","starred_url":"https://api.github.com/users/andrecardoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrecardoso/subscriptions","organizations_url":"https://api.github.com/users/andrecardoso/orgs","repos_url":"https://api.github.com/users/andrecardoso/repos","events_url":"https://api.github.com/users/andrecardoso/events{/privacy}","received_events_url":"https://api.github.com/users/andrecardoso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andrecardoso/parse-server","description":"Parse-compatible API server module for Node/Express","fork":true,"url":"https://api.github.com/repos/andrecardoso/parse-server","forks_url":"https://api.github.com/repos/andrecardoso/parse-server/forks","keys_url":"https://api.github.com/repos/andrecardoso/parse-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andrecardoso/parse-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andrecardoso/parse-server/teams","hooks_url":"https://api.github.com/repos/andrecardoso/parse-server/hooks","issue_events_url":"https://api.github.com/repos/andrecardoso/parse-server/issues/events{/number}","events_url":"https://api.github.com/repos/andrecardoso/parse-server/events","assignees_url":"https://api.github.com/repos/andrecardoso/parse-server/assignees{/user}","branches_url":"https://api.github.com/repos/andrecardoso/parse-server/branches{/branch}","tags_url":"https://api.github.com/repos/andrecardoso/parse-server/tags","blobs_url":"https://api.github.com/repos/andrecardoso/parse-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andrecardoso/parse-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andrecardoso/parse-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/andrecardoso/parse-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andrecardoso/parse-server/statuses/{sha}","languages_url":"https://api.github.com/repos/andrecardoso/parse-server/languages","stargazers_url":"https://api.github.com/repos/andrecardoso/parse-server/stargazers","contributors_url":"https://api.github.com/repos/andrecardoso/parse-server/contributors","subscribers_url":"https://api.github.com/repos/andrecardoso/parse-server/subscribers","subscription_url":"https://api.github.com/repos/andrecardoso/parse-server/subscription","commits_url":"https://api.github.com/repos/andrecardoso/parse-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/andrecardoso/parse-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/andrecardoso/parse-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/andrecardoso/parse-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/andrecardoso/parse-server/contents/{+path}","compare_url":"https://api.github.com/repos/andrecardoso/parse-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andrecardoso/parse-server/merges","archive_url":"https://api.github.com/repos/andrecardoso/parse-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andrecardoso/parse-server/downloads","issues_url":"https://api.github.com/repos/andrecardoso/parse-server/issues{/number}","pulls_url":"https://api.github.com/repos/andrecardoso/parse-server/pulls{/number}","milestones_url":"https://api.github.com/repos/andrecardoso/parse-server/milestones{/number}","notifications_url":"https://api.github.com/repos/andrecardoso/parse-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andrecardoso/parse-server/labels{/name}","releases_url":"https://api.github.com/repos/andrecardoso/parse-server/releases{/id}","deployments_url":"https://api.github.com/repos/andrecardoso/parse-server/deployments","created_at":"2016-03-29T14:12:36Z","updated_at":"2016-03-29T14:12:38Z","pushed_at":"2016-03-29T14:29:37Z","git_url":"git://github.com/andrecardoso/parse-server.git","ssh_url":"git@github.com:andrecardoso/parse-server.git","clone_url":"https://github.com/andrecardoso/parse-server.git","svn_url":"https://github.com/andrecardoso/parse-server","homepage":null,"size":1372,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ParsePlatform:master","ref":"master","sha":"592334756b939b679104ce32fd703c47cdeabd6d","user":{"login":"ParsePlatform","id":1294580,"avatar_url":"https://avatars.githubusercontent.com/u/1294580?v=3","gravatar_id":"","url":"https://api.github.com/users/ParsePlatform","html_url":"https://github.com/ParsePlatform","followers_url":"https://api.github.com/users/ParsePlatform/followers","following_url":"https://api.github.com/users/ParsePlatform/following{/other_user}","gists_url":"https://api.github.com/users/ParsePlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/ParsePlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ParsePlatform/subscriptions","organizations_url":"https://api.github.com/users/ParsePlatform/orgs","repos_url":"https://api.github.com/users/ParsePlatform/repos","events_url":"https://api.github.com/users/ParsePlatform/events{/privacy}","received_events_url":"https://api.github.com/users/ParsePlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":50603846,"name":"parse-server","full_name":"ParsePlatform/parse-server","owner":{"login":"ParsePlatform","id":1294580,"avatar_url":"https://avatars.githubusercontent.com/u/1294580?v=3","gravatar_id":"","url":"https://api.github.com/users/ParsePlatform","html_url":"https://github.com/ParsePlatform","followers_url":"https://api.github.com/users/ParsePlatform/followers","following_url":"https://api.github.com/users/ParsePlatform/following{/other_user}","gists_url":"https://api.github.com/users/ParsePlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/ParsePlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ParsePlatform/subscriptions","organizations_url":"https://api.github.com/users/ParsePlatform/orgs","repos_url":"https://api.github.com/users/ParsePlatform/repos","events_url":"https://api.github.com/users/ParsePlatform/events{/privacy}","received_events_url":"https://api.github.com/users/ParsePlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ParsePlatform/parse-server","description":"Parse-compatible API server module for Node/Express","fork":false,"url":"https://api.github.com/repos/ParsePlatform/parse-server","forks_url":"https://api.github.com/repos/ParsePlatform/parse-server/forks","keys_url":"https://api.github.com/repos/ParsePlatform/parse-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ParsePlatform/parse-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ParsePlatform/parse-server/teams","hooks_url":"https://api.github.com/repos/ParsePlatform/parse-server/hooks","issue_events_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/events{/number}","events_url":"https://api.github.com/repos/ParsePlatform/parse-server/events","assignees_url":"https://api.github.com/repos/ParsePlatform/parse-server/assignees{/user}","branches_url":"https://api.github.com/repos/ParsePlatform/parse-server/branches{/branch}","tags_url":"https://api.github.com/repos/ParsePlatform/parse-server/tags","blobs_url":"https://api.github.com/repos/ParsePlatform/parse-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ParsePlatform/parse-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ParsePlatform/parse-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/ParsePlatform/parse-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ParsePlatform/parse-server/statuses/{sha}","languages_url":"https://api.github.com/repos/ParsePlatform/parse-server/languages","stargazers_url":"https://api.github.com/repos/ParsePlatform/parse-server/stargazers","contributors_url":"https://api.github.com/repos/ParsePlatform/parse-server/contributors","subscribers_url":"https://api.github.com/repos/ParsePlatform/parse-server/subscribers","subscription_url":"https://api.github.com/repos/ParsePlatform/parse-server/subscription","commits_url":"https://api.github.com/repos/ParsePlatform/parse-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/ParsePlatform/parse-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/ParsePlatform/parse-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/ParsePlatform/parse-server/contents/{+path}","compare_url":"https://api.github.com/repos/ParsePlatform/parse-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ParsePlatform/parse-server/merges","archive_url":"https://api.github.com/repos/ParsePlatform/parse-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ParsePlatform/parse-server/downloads","issues_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues{/number}","pulls_url":"https://api.github.com/repos/ParsePlatform/parse-server/pulls{/number}","milestones_url":"https://api.github.com/repos/ParsePlatform/parse-server/milestones{/number}","notifications_url":"https://api.github.com/repos/ParsePlatform/parse-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ParsePlatform/parse-server/labels{/name}","releases_url":"https://api.github.com/repos/ParsePlatform/parse-server/releases{/id}","deployments_url":"https://api.github.com/repos/ParsePlatform/parse-server/deployments","created_at":"2016-01-28T18:29:14Z","updated_at":"2016-03-29T15:22:34Z","pushed_at":"2016-03-29T15:09:38Z","git_url":"git://github.com/ParsePlatform/parse-server.git","ssh_url":"git@github.com:ParsePlatform/parse-server.git","clone_url":"https://github.com/ParsePlatform/parse-server.git","svn_url":"https://github.com/ParsePlatform/parse-server","homepage":null,"size":2832,"stargazers_count":7744,"watchers_count":7744,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1835,"mirror_url":null,"open_issues_count":107,"forks":1835,"open_issues":107,"watchers":7744,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/1250"},"html":{"href":"https://github.com/ParsePlatform/parse-server/pull/1250"},"issue":{"href":"https://api.github.com/repos/ParsePlatform/parse-server/issues/1250"},"comments":{"href":"https://api.github.com/repos/ParsePlatform/parse-server/issues/1250/comments"},"review_comments":{"href":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/1250/comments"},"review_comment":{"href":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/1250/commits"},"statuses":{"href":"https://api.github.com/repos/ParsePlatform/parse-server/statuses/3dccd612225b46a9759f0f3c3ad79d240a2a0c24"}}}}