{"action":"created","issue":{"url":"https://api.github.com/repos/fakemongo/fongo/issues/182","repository_url":"https://api.github.com/repos/fakemongo/fongo","labels_url":"https://api.github.com/repos/fakemongo/fongo/issues/182/labels{/name}","comments_url":"https://api.github.com/repos/fakemongo/fongo/issues/182/comments","events_url":"https://api.github.com/repos/fakemongo/fongo/issues/182/events","html_url":"https://github.com/fakemongo/fongo/issues/182","id":131028920,"number":182,"title":"Projection on aggregation does not work with $size","user":{"login":"zxkane","id":843303,"avatar_url":"https://avatars.githubusercontent.com/u/843303?v=3","gravatar_id":"","url":"https://api.github.com/users/zxkane","html_url":"https://github.com/zxkane","followers_url":"https://api.github.com/users/zxkane/followers","following_url":"https://api.github.com/users/zxkane/following{/other_user}","gists_url":"https://api.github.com/users/zxkane/gists{/gist_id}","starred_url":"https://api.github.com/users/zxkane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zxkane/subscriptions","organizations_url":"https://api.github.com/users/zxkane/orgs","repos_url":"https://api.github.com/users/zxkane/repos","events_url":"https://api.github.com/users/zxkane/events{/privacy}","received_events_url":"https://api.github.com/users/zxkane/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"twillouer","id":2970220,"avatar_url":"https://avatars.githubusercontent.com/u/2970220?v=3","gravatar_id":"","url":"https://api.github.com/users/twillouer","html_url":"https://github.com/twillouer","followers_url":"https://api.github.com/users/twillouer/followers","following_url":"https://api.github.com/users/twillouer/following{/other_user}","gists_url":"https://api.github.com/users/twillouer/gists{/gist_id}","starred_url":"https://api.github.com/users/twillouer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twillouer/subscriptions","organizations_url":"https://api.github.com/users/twillouer/orgs","repos_url":"https://api.github.com/users/twillouer/repos","events_url":"https://api.github.com/users/twillouer/events{/privacy}","received_events_url":"https://api.github.com/users/twillouer/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/fakemongo/fongo/milestones/38","html_url":"https://github.com/fakemongo/fongo/milestones/1.6.7","labels_url":"https://api.github.com/repos/fakemongo/fongo/milestones/38/labels","id":1580268,"number":38,"title":"1.6.7","description":null,"creator":{"login":"twillouer","id":2970220,"avatar_url":"https://avatars.githubusercontent.com/u/2970220?v=3","gravatar_id":"","url":"https://api.github.com/users/twillouer","html_url":"https://github.com/twillouer","followers_url":"https://api.github.com/users/twillouer/followers","following_url":"https://api.github.com/users/twillouer/following{/other_user}","gists_url":"https://api.github.com/users/twillouer/gists{/gist_id}","starred_url":"https://api.github.com/users/twillouer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twillouer/subscriptions","organizations_url":"https://api.github.com/users/twillouer/orgs","repos_url":"https://api.github.com/users/twillouer/repos","events_url":"https://api.github.com/users/twillouer/events{/privacy}","received_events_url":"https://api.github.com/users/twillouer/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":8,"state":"open","created_at":"2016-02-12T18:28:45Z","updated_at":"2016-02-20T18:37:32Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-02-03T13:39:26Z","updated_at":"2016-02-21T15:41:28Z","closed_at":"2016-02-19T14:49:37Z","body":"Fongo: 1.6.5\r\n\r\nBelow query can be executed in mongo shell, then return a field named **likedCount** with the size of array field `liked`.\r\n\r\n```javascript\r\ndb.myCol.aggregate([{$match: {liked: {$ne: null}}}, {$project: {viewCount: 1, likedCount: {$size: [\"$liked\"]}, liked: 1} }, {$sort: {viewCount: -1, likedCount: -1}}, {$limit: 1}])\r\n```"},"comment":{"url":"https://api.github.com/repos/fakemongo/fongo/issues/comments/186846119","html_url":"https://github.com/fakemongo/fongo/issues/182#issuecomment-186846119","issue_url":"https://api.github.com/repos/fakemongo/fongo/issues/182","id":186846119,"user":{"login":"twillouer","id":2970220,"avatar_url":"https://avatars.githubusercontent.com/u/2970220?v=3","gravatar_id":"","url":"https://api.github.com/users/twillouer","html_url":"https://github.com/twillouer","followers_url":"https://api.github.com/users/twillouer/followers","following_url":"https://api.github.com/users/twillouer/following{/other_user}","gists_url":"https://api.github.com/users/twillouer/gists{/gist_id}","starred_url":"https://api.github.com/users/twillouer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twillouer/subscriptions","organizations_url":"https://api.github.com/users/twillouer/orgs","repos_url":"https://api.github.com/users/twillouer/repos","events_url":"https://api.github.com/users/twillouer/events{/privacy}","received_events_url":"https://api.github.com/users/twillouer/received_events","type":"User","site_admin":false},"created_at":"2016-02-21T15:41:28Z","updated_at":"2016-02-21T15:41:28Z","body":"done, compatibility with 2.13.\r\n\r\nBut, difficult to maintain"}}