{"action":"created","issue":{"url":"https://api.github.com/repos/doctrine/mongodb/issues/201","labels_url":"https://api.github.com/repos/doctrine/mongodb/issues/201/labels{/name}","comments_url":"https://api.github.com/repos/doctrine/mongodb/issues/201/comments","events_url":"https://api.github.com/repos/doctrine/mongodb/issues/201/events","html_url":"https://github.com/doctrine/mongodb/pull/201","id":52718993,"number":201,"title":"Fix issue when an operator follows equals()","user":{"login":"alcaeus","id":383198,"avatar_url":"https://avatars.githubusercontent.com/u/383198?v=3","gravatar_id":"","url":"https://api.github.com/users/alcaeus","html_url":"https://github.com/alcaeus","followers_url":"https://api.github.com/users/alcaeus/followers","following_url":"https://api.github.com/users/alcaeus/following{/other_user}","gists_url":"https://api.github.com/users/alcaeus/gists{/gist_id}","starred_url":"https://api.github.com/users/alcaeus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alcaeus/subscriptions","organizations_url":"https://api.github.com/users/alcaeus/orgs","repos_url":"https://api.github.com/users/alcaeus/repos","events_url":"https://api.github.com/users/alcaeus/events{/privacy}","received_events_url":"https://api.github.com/users/alcaeus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/doctrine/mongodb/labels/bug","name":"bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/doctrine/mongodb/milestones/4","labels_url":"https://api.github.com/repos/doctrine/mongodb/milestones/4/labels","id":502562,"number":4,"title":"1.2.0","description":"","creator":{"login":"jmikola","id":244663,"avatar_url":"https://avatars.githubusercontent.com/u/244663?v=3","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},"open_issues":7,"closed_issues":9,"state":"open","created_at":"2013-12-02T15:58:07Z","updated_at":"2015-01-02T16:42:12Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2014-12-23T07:02:06Z","updated_at":"2015-01-02T17:05:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/doctrine/mongodb/pulls/201","html_url":"https://github.com/doctrine/mongodb/pull/201","diff_url":"https://github.com/doctrine/mongodb/pull/201.diff","patch_url":"https://github.com/doctrine/mongodb/pull/201.patch"},"body":"This fixes #181 by overwriting the existing query with an empty array to avoid invalid string offsets or invalid array accesses when calling any query operator after having called ```equals()``` on the field."},"comment":{"url":"https://api.github.com/repos/doctrine/mongodb/issues/comments/68542496","html_url":"https://github.com/doctrine/mongodb/pull/201#issuecomment-68542496","issue_url":"https://api.github.com/repos/doctrine/mongodb/issues/201","id":68542496,"user":{"login":"jmikola","id":244663,"avatar_url":"https://avatars.githubusercontent.com/u/244663?v=3","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},"created_at":"2015-01-02T17:05:03Z","updated_at":"2015-01-02T17:05:03Z","body":"@alcaeus: I'm unsure if overriding the previous equality criteria is the best course of action here. Ideally, we'd wrap the previous equality with `$eq`, but that isn't supported until [server 2.8](http://docs.mongodb.org/v2.8/reference/operator/query/eq/).\r\n\r\nFor a backwards compatible approach, we could wrap the original equality criteria in a single-element `$in` array; however, your particular test is evidence that overwriting is still possible. This is also more likely to elicit WTFs from users.\r\n\r\nWould it be more straightforward to use `$eq` (the proper solution) and invite an exception if the server doesn't support it?"}}