{"action":"opened","issue":{"url":"https://api.github.com/repos/fakemongo/fongo/issues/163","labels_url":"https://api.github.com/repos/fakemongo/fongo/issues/163/labels{/name}","comments_url":"https://api.github.com/repos/fakemongo/fongo/issues/163/comments","events_url":"https://api.github.com/repos/fakemongo/fongo/issues/163/events","html_url":"https://github.com/fakemongo/fongo/issues/163","id":118200938,"number":163,"title":"Aggregation on date returns null","user":{"login":"riyyaz","id":7670431,"avatar_url":"https://avatars.githubusercontent.com/u/7670431?v=3","gravatar_id":"","url":"https://api.github.com/users/riyyaz","html_url":"https://github.com/riyyaz","followers_url":"https://api.github.com/users/riyyaz/followers","following_url":"https://api.github.com/users/riyyaz/following{/other_user}","gists_url":"https://api.github.com/users/riyyaz/gists{/gist_id}","starred_url":"https://api.github.com/users/riyyaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riyyaz/subscriptions","organizations_url":"https://api.github.com/users/riyyaz/orgs","repos_url":"https://api.github.com/users/riyyaz/repos","events_url":"https://api.github.com/users/riyyaz/events{/privacy}","received_events_url":"https://api.github.com/users/riyyaz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-21T14:39:12Z","updated_at":"2015-11-21T14:39:12Z","closed_at":null,"body":"        Fongo fongo = new Fongo(\"mongo server 1\");\r\n\r\n\t\tDB db = fongo.getDB(\"mydb\");\r\n\t\tDBCollection collection = db.getCollection(\"mycollection\");\r\n\t\tcollection.insert(new BasicDBObject(\"t\", new java.util.Date()));\r\n\r\n\t\tBasicDBObject obj = new BasicDBObject(\"$group\",\r\n\t\t\t\tnew BasicDBObject(\"_id\", new BasicDBObject(\"day\", new BasicDBObject(\"$dayOfMonth\", \"$t\"))));\r\n\r\n\t\tAggregationOutput ao = collection.aggregate(Arrays.asList(obj));\r\n\t\tIterator<DBObject> dbo = ao.results().iterator();\r\n\t\twhile (dbo.hasNext()) {\r\n\t\t\tSystem.out.println(dbo.next());\r\n\t\t}\r\n\r\n\r\n\r\nThe above code returns the aggregated day as null\r\n\r\n{ \"_id\" : { \"day\" :  null }}\r\n"}}