{"action":"created","issue":{"url":"https://api.github.com/repos/hapijs/hoek/issues/152","labels_url":"https://api.github.com/repos/hapijs/hoek/issues/152/labels{/name}","comments_url":"https://api.github.com/repos/hapijs/hoek/issues/152/comments","events_url":"https://api.github.com/repos/hapijs/hoek/issues/152/events","html_url":"https://github.com/hapijs/hoek/issues/152","id":100729194,"number":152,"title":"Hoek.reach and non standard JS objects","user":{"login":"MathieuLoutre","id":106054,"avatar_url":"https://avatars.githubusercontent.com/u/106054?v=3","gravatar_id":"","url":"https://api.github.com/users/MathieuLoutre","html_url":"https://github.com/MathieuLoutre","followers_url":"https://api.github.com/users/MathieuLoutre/followers","following_url":"https://api.github.com/users/MathieuLoutre/following{/other_user}","gists_url":"https://api.github.com/users/MathieuLoutre/gists{/gist_id}","starred_url":"https://api.github.com/users/MathieuLoutre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MathieuLoutre/subscriptions","organizations_url":"https://api.github.com/users/MathieuLoutre/orgs","repos_url":"https://api.github.com/users/MathieuLoutre/repos","events_url":"https://api.github.com/users/MathieuLoutre/events{/privacy}","received_events_url":"https://api.github.com/users/MathieuLoutre/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hapijs/hoek/labels/request","name":"request","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-13T10:01:47Z","updated_at":"2015-08-13T12:08:00Z","closed_at":null,"body":"I've posted on the hapijs repo before and it explains the situation in detail: https://github.com/hapijs/hapi/issues/2644\r\n\r\nMongoose objects likely override . and [] notations for access because `Object.getOwnPropertyNames(ref)` does not reveal any of the object attributes. Because of that, `Hoek.reach` struggles to get to the particular attribute when it's something like `mongooseObject.attribute`.\r\n\r\nI realise it's a pretty specific use case, but if there were a way to adapt the code so it still works, it would be brilliant.\r\n\r\nFrom the hapijs issue:\r\n\r\nI found that the Mongoose object doesn't seem to return anything on `ref.hasOwnProperty(path[i])` and therefore fails. However, `ref[path[i]]` does exist and returns something. Checking for `ref[path[i]]` instead of `ref.hasOwnProperty(path[i])` does not fix the problem, but maybe there's a solution."},"comment":{"url":"https://api.github.com/repos/hapijs/hoek/issues/comments/130644590","html_url":"https://github.com/hapijs/hoek/issues/152#issuecomment-130644590","issue_url":"https://api.github.com/repos/hapijs/hoek/issues/152","id":130644590,"user":{"login":"MathieuLoutre","id":106054,"avatar_url":"https://avatars.githubusercontent.com/u/106054?v=3","gravatar_id":"","url":"https://api.github.com/users/MathieuLoutre","html_url":"https://github.com/MathieuLoutre","followers_url":"https://api.github.com/users/MathieuLoutre/followers","following_url":"https://api.github.com/users/MathieuLoutre/following{/other_user}","gists_url":"https://api.github.com/users/MathieuLoutre/gists{/gist_id}","starred_url":"https://api.github.com/users/MathieuLoutre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MathieuLoutre/subscriptions","organizations_url":"https://api.github.com/users/MathieuLoutre/orgs","repos_url":"https://api.github.com/users/MathieuLoutre/repos","events_url":"https://api.github.com/users/MathieuLoutre/events{/privacy}","received_events_url":"https://api.github.com/users/MathieuLoutre/received_events","type":"User","site_admin":false},"created_at":"2015-08-13T12:08:00Z","updated_at":"2015-08-13T12:08:00Z","body":"Yes, pretty sure. However, just realised that I was working on an older version of Hoek. Will try on the latest and see what happens."}}