{"action":"created","issue":{"url":"https://api.github.com/repos/phalcon/cphalcon/issues/11031","labels_url":"https://api.github.com/repos/phalcon/cphalcon/issues/11031/labels{/name}","comments_url":"https://api.github.com/repos/phalcon/cphalcon/issues/11031/comments","events_url":"https://api.github.com/repos/phalcon/cphalcon/issues/11031/events","html_url":"https://github.com/phalcon/cphalcon/issues/11031","id":112033828,"number":11031,"title":"Fix ODM logic","user":{"login":"dzubchik","id":2685761,"avatar_url":"https://avatars.githubusercontent.com/u/2685761?v=3","gravatar_id":"","url":"https://api.github.com/users/dzubchik","html_url":"https://github.com/dzubchik","followers_url":"https://api.github.com/users/dzubchik/followers","following_url":"https://api.github.com/users/dzubchik/following{/other_user}","gists_url":"https://api.github.com/users/dzubchik/gists{/gist_id}","starred_url":"https://api.github.com/users/dzubchik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzubchik/subscriptions","organizations_url":"https://api.github.com/users/dzubchik/orgs","repos_url":"https://api.github.com/users/dzubchik/repos","events_url":"https://api.github.com/users/dzubchik/events{/privacy}","received_events_url":"https://api.github.com/users/dzubchik/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/phalcon/cphalcon/labels/New%20Feature%20Request","name":"New Feature Request","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-18T18:30:42Z","updated_at":"2015-10-20T18:10:19Z","closed_at":null,"body":"Currently ODM working in some interesting way. When do query with set of fields - it returns document,  without - returns collection. My proposition is to correct this - always return document or set of documents, and give ability to change document class to be returned. How about that?"},"comment":{"url":"https://api.github.com/repos/phalcon/cphalcon/issues/comments/149651088","html_url":"https://github.com/phalcon/cphalcon/issues/11031#issuecomment-149651088","issue_url":"https://api.github.com/repos/phalcon/cphalcon/issues/11031","id":149651088,"user":{"login":"ashpumpkin","id":1420625,"avatar_url":"https://avatars.githubusercontent.com/u/1420625?v=3","gravatar_id":"","url":"https://api.github.com/users/ashpumpkin","html_url":"https://github.com/ashpumpkin","followers_url":"https://api.github.com/users/ashpumpkin/followers","following_url":"https://api.github.com/users/ashpumpkin/following{/other_user}","gists_url":"https://api.github.com/users/ashpumpkin/gists{/gist_id}","starred_url":"https://api.github.com/users/ashpumpkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashpumpkin/subscriptions","organizations_url":"https://api.github.com/users/ashpumpkin/orgs","repos_url":"https://api.github.com/users/ashpumpkin/repos","events_url":"https://api.github.com/users/ashpumpkin/events{/privacy}","received_events_url":"https://api.github.com/users/ashpumpkin/received_events","type":"User","site_admin":false},"created_at":"2015-10-20T18:10:19Z","updated_at":"2015-10-20T18:10:19Z","body":"@sergeyklay why not?\r\n```PHP\r\nRobots::find(); //returns Robots\r\nRobots::find(['hydration' => Collection::HYDRATE_DOCUMENTS]); // you get Documents\r\nRobots::find(['hydration' => Collection::HYDRATE_COLLECTIONS]); // you get Robots\r\nRobots::find(['hydration' => Collection::HYDRATE_ARRAYS]); // you get raw arrays (the fastest one)\r\n```\r\nand the same works with findFirst(). I think the problem is completely solved :smiley: "}}