{"action":"closed","issue":{"url":"https://api.github.com/repos/LearnBoost/mongoose/issues/2628","labels_url":"https://api.github.com/repos/LearnBoost/mongoose/issues/2628/labels{/name}","comments_url":"https://api.github.com/repos/LearnBoost/mongoose/issues/2628/comments","events_url":"https://api.github.com/repos/LearnBoost/mongoose/issues/2628/events","html_url":"https://github.com/LearnBoost/mongoose/issues/2628","id":55820092,"number":2628,"title":"Docs error: wrong parameter order for distinct()","user":{"login":"EgoAleSum","id":43508,"avatar_url":"https://avatars.githubusercontent.com/u/43508?v=3","gravatar_id":"","url":"https://api.github.com/users/EgoAleSum","html_url":"https://github.com/EgoAleSum","followers_url":"https://api.github.com/users/EgoAleSum/followers","following_url":"https://api.github.com/users/EgoAleSum/following{/other_user}","gists_url":"https://api.github.com/users/EgoAleSum/gists{/gist_id}","starred_url":"https://api.github.com/users/EgoAleSum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EgoAleSum/subscriptions","organizations_url":"https://api.github.com/users/EgoAleSum/orgs","repos_url":"https://api.github.com/users/EgoAleSum/repos","events_url":"https://api.github.com/users/EgoAleSum/events{/privacy}","received_events_url":"https://api.github.com/users/EgoAleSum/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/LearnBoost/mongoose/labels/confirmed-bug","name":"confirmed-bug","color":"e10c02"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/LearnBoost/mongoose/milestones/22","labels_url":"https://api.github.com/repos/LearnBoost/mongoose/milestones/22/labels","id":893197,"number":22,"title":"4.0.0-rc0","description":"","creator":{"login":"vkarpov15","id":1620265,"avatar_url":"https://avatars.githubusercontent.com/u/1620265?v=3","gravatar_id":"","url":"https://api.github.com/users/vkarpov15","html_url":"https://github.com/vkarpov15","followers_url":"https://api.github.com/users/vkarpov15/followers","following_url":"https://api.github.com/users/vkarpov15/following{/other_user}","gists_url":"https://api.github.com/users/vkarpov15/gists{/gist_id}","starred_url":"https://api.github.com/users/vkarpov15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkarpov15/subscriptions","organizations_url":"https://api.github.com/users/vkarpov15/orgs","repos_url":"https://api.github.com/users/vkarpov15/repos","events_url":"https://api.github.com/users/vkarpov15/events{/privacy}","received_events_url":"https://api.github.com/users/vkarpov15/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":24,"state":"open","created_at":"2014-12-05T17:14:46Z","updated_at":"2015-01-29T16:15:57Z","due_on":"2015-01-24T05:00:00Z","closed_at":null},"comments":2,"created_at":"2015-01-28T21:43:05Z","updated_at":"2015-01-29T16:15:57Z","closed_at":"2015-01-29T16:15:57Z","body":"The docs ( http://mongoosejs.com/docs/api.html#query_Query-distinct ) say that the parameter order is: `Query#distinct([criteria], [field], [callback])`.\r\n\r\nAfter wasting 30 minutes with a very obscure error when using all 3 arguments, I found out that the parameter are actually reversed: `Query#distinct([field], [criteria], [callback])`. This works."}}