{"action":"created","issue":{"url":"https://api.github.com/repos/tgriesser/bookshelf/issues/960","labels_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/960/labels{/name}","comments_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/960/comments","events_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/960/events","html_url":"https://github.com/tgriesser/bookshelf/issues/960","id":112571687,"number":960,"title":"Virtuals only work with objects, not arrays","user":{"login":"jpstone","id":5823372,"avatar_url":"https://avatars.githubusercontent.com/u/5823372?v=3","gravatar_id":"","url":"https://api.github.com/users/jpstone","html_url":"https://github.com/jpstone","followers_url":"https://api.github.com/users/jpstone/followers","following_url":"https://api.github.com/users/jpstone/following{/other_user}","gists_url":"https://api.github.com/users/jpstone/gists{/gist_id}","starred_url":"https://api.github.com/users/jpstone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpstone/subscriptions","organizations_url":"https://api.github.com/users/jpstone/orgs","repos_url":"https://api.github.com/users/jpstone/repos","events_url":"https://api.github.com/users/jpstone/events{/privacy}","received_events_url":"https://api.github.com/users/jpstone/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-21T12:01:06Z","updated_at":"2015-10-21T14:09:54Z","closed_at":null,"body":"My virtuals work fine when doing \"select * from table where id = x\". But if I do a \"select * from table\" all of my virtuals are undefined.\r\n\r\nIt seems like the use-case for virtuals was intended only for single records from the database, not a list of records. Any plans on supporting arrays?\r\n\r\nIn the meantime, any suggestions on how to work around this?"},"comment":{"url":"https://api.github.com/repos/tgriesser/bookshelf/issues/comments/149907766","html_url":"https://github.com/tgriesser/bookshelf/issues/960#issuecomment-149907766","issue_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/960","id":149907766,"user":{"login":"jpstone","id":5823372,"avatar_url":"https://avatars.githubusercontent.com/u/5823372?v=3","gravatar_id":"","url":"https://api.github.com/users/jpstone","html_url":"https://github.com/jpstone","followers_url":"https://api.github.com/users/jpstone/followers","following_url":"https://api.github.com/users/jpstone/following{/other_user}","gists_url":"https://api.github.com/users/jpstone/gists{/gist_id}","starred_url":"https://api.github.com/users/jpstone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpstone/subscriptions","organizations_url":"https://api.github.com/users/jpstone/orgs","repos_url":"https://api.github.com/users/jpstone/repos","events_url":"https://api.github.com/users/jpstone/events{/privacy}","received_events_url":"https://api.github.com/users/jpstone/received_events","type":"User","site_admin":false},"created_at":"2015-10-21T14:09:54Z","updated_at":"2015-10-21T14:09:54Z","body":"Sure enough, this issue is happening because parse() isn't working on fetchAll(), only fetch(). I tested by changing my this.get('columnName') to this.get('column_name') and the virtuals worked.\r\n\r\nYou can close this and refer to issue https://github.com/tgriesser/bookshelf/issues/962"}}