{"action":"created","issue":{"url":"https://api.github.com/repos/meteor/postgres-packages/issues/42","labels_url":"https://api.github.com/repos/meteor/postgres-packages/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/meteor/postgres-packages/issues/42/comments","events_url":"https://api.github.com/repos/meteor/postgres-packages/issues/42/events","html_url":"https://github.com/meteor/postgres-packages/issues/42","id":110452556,"number":42,"title":"Print out all records and fields from a table using console.log","user":{"login":"yoonghm","id":4215991,"avatar_url":"https://avatars.githubusercontent.com/u/4215991?v=3","gravatar_id":"","url":"https://api.github.com/users/yoonghm","html_url":"https://github.com/yoonghm","followers_url":"https://api.github.com/users/yoonghm/followers","following_url":"https://api.github.com/users/yoonghm/following{/other_user}","gists_url":"https://api.github.com/users/yoonghm/gists{/gist_id}","starred_url":"https://api.github.com/users/yoonghm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoonghm/subscriptions","organizations_url":"https://api.github.com/users/yoonghm/orgs","repos_url":"https://api.github.com/users/yoonghm/repos","events_url":"https://api.github.com/users/yoonghm/events{/privacy}","received_events_url":"https://api.github.com/users/yoonghm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-08T13:36:35Z","updated_at":"2015-10-08T13:42:52Z","closed_at":null,"body":"I have a table\r\n```\r\ntodo=# \\d+ items\r\n                                                    Table \"public.items\"\r\n Column |         Type          |                     Modifiers                      | Storage  | Stats target | Description \r\n--------+-----------------------+----------------------------------------------------+----------+--------------+-------------\r\n id     | integer               | not null default nextval('items_id_seq'::regclass) | plain    |              | \r\n task   | character varying(64) |                                                    | extended |              | \r\n```\r\n\r\nIt has the following records\r\n```\r\ntodo=# select * from items;\r\n id |     task      \r\n----+---------------\r\n  1 | Eat lunch\r\n  2 | Eat dinner\r\n  3 | Eat breakfast\r\n  4 | Study\r\n  5 | Sleep\r\n  6 | Bath\r\n(6 rows)\r\n```\r\nHow to you print out all records, all columns from the table? I did that but it is not correct:\r\n\r\n```\r\nItems = new PG.Table(\"items\");\r\nvar records = Items.select('id', 'task').orderBy('id').fetch();\r\nfor (var x in records) {\r\n  console.log(x);\r\n}\r\n```\r\nwhich gives\r\n\r\n```\r\n0\r\n1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n```"},"comment":{"url":"https://api.github.com/repos/meteor/postgres-packages/issues/comments/146549218","html_url":"https://github.com/meteor/postgres-packages/issues/42#issuecomment-146549218","issue_url":"https://api.github.com/repos/meteor/postgres-packages/issues/42","id":146549218,"user":{"login":"robfallows","id":6086035,"avatar_url":"https://avatars.githubusercontent.com/u/6086035?v=3","gravatar_id":"","url":"https://api.github.com/users/robfallows","html_url":"https://github.com/robfallows","followers_url":"https://api.github.com/users/robfallows/followers","following_url":"https://api.github.com/users/robfallows/following{/other_user}","gists_url":"https://api.github.com/users/robfallows/gists{/gist_id}","starred_url":"https://api.github.com/users/robfallows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robfallows/subscriptions","organizations_url":"https://api.github.com/users/robfallows/orgs","repos_url":"https://api.github.com/users/robfallows/repos","events_url":"https://api.github.com/users/robfallows/events{/privacy}","received_events_url":"https://api.github.com/users/robfallows/received_events","type":"User","site_admin":false},"created_at":"2015-10-08T13:42:51Z","updated_at":"2015-10-08T13:42:51Z","body":"```\r\nItems = new PG.Table(\"items\");\r\nvar records = Items.select('id', 'task').orderBy('id').fetch();\r\nfor (var x in records) {\r\n  console.log(records[x]);\r\n}\r\n```\r\n\r\nor\r\n\r\n```\r\nItems = new PG.Table(\"items\");\r\nvar records = Items.select('id', 'task').orderBy('id').fetch();\r\n_.each(records, (row) => {\r\n  console.log(row);\r\n}\r\n```"}}