{"action":"opened","issue":{"url":"https://api.github.com/repos/bwaldvogel/mongo-java-server/issues/35","repository_url":"https://api.github.com/repos/bwaldvogel/mongo-java-server","labels_url":"https://api.github.com/repos/bwaldvogel/mongo-java-server/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/bwaldvogel/mongo-java-server/issues/35/comments","events_url":"https://api.github.com/repos/bwaldvogel/mongo-java-server/issues/35/events","html_url":"https://github.com/bwaldvogel/mongo-java-server/issues/35","id":387341453,"node_id":"MDU6SXNzdWUzODczNDE0NTM=","number":35,"title":"Query for embedded document is different","user":{"login":"marchpig","id":17305893,"node_id":"MDQ6VXNlcjE3MzA1ODkz","avatar_url":"https://avatars0.githubusercontent.com/u/17305893?v=4","gravatar_id":"","url":"https://api.github.com/users/marchpig","html_url":"https://github.com/marchpig","followers_url":"https://api.github.com/users/marchpig/followers","following_url":"https://api.github.com/users/marchpig/following{/other_user}","gists_url":"https://api.github.com/users/marchpig/gists{/gist_id}","starred_url":"https://api.github.com/users/marchpig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marchpig/subscriptions","organizations_url":"https://api.github.com/users/marchpig/orgs","repos_url":"https://api.github.com/users/marchpig/repos","events_url":"https://api.github.com/users/marchpig/events{/privacy}","received_events_url":"https://api.github.com/users/marchpig/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-04T15:29:58Z","updated_at":"2018-12-04T15:29:58Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI found that the query result for embedded document is different with the real DB.\r\nThe following test is failed as the `1st` document is not found by the query.\r\n```java\r\n@Test\r\npublic void test() {\r\n    mongoTemplate.insert(new A()); // 1st\r\n    mongoTemplate.insert(new A(new B())); // 2nd\r\n    mongoTemplate.insert(new A(new B(new C()))); // 3rd\r\n\r\n    List<A> list = mongoTemplate.find(Query.query(Criteria.where(\"b.c\").is(null)), A.class);\r\n\r\n    Assert.assertEquals(2, list.size()); // Failed here [Expected:2  / Actual:1]\r\n    list.forEach(a -> Assert.assertTrue(a.b == null || a.b.c == null));\r\n}\r\n```\r\n```java\r\npublic class A {\r\n    public B b;\r\n\r\n    public A() {}\r\n    public A(B b) {\r\n        this.b = b;\r\n    }\r\n}\r\n```\r\n```java\r\npublic class B {\r\n    public C c;\r\n\r\n    public B() {}\r\n    public B(C c) {\r\n        this.c = c;\r\n    }\r\n}\r\n```\r\n```java\r\npublic class C {\r\n}\r\n```\r\n\r\nThanks!"}}
{"actor":{"display_login":"marchpig"}}