{"action":"created","issue":{"url":"https://api.github.com/repos/jden/minq/issues/17","labels_url":"https://api.github.com/repos/jden/minq/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/jden/minq/issues/17/comments","events_url":"https://api.github.com/repos/jden/minq/issues/17/events","html_url":"https://github.com/jden/minq/issues/17","id":41214502,"number":17,"title":"forEach, when used in a script, throws \"Object #<Object> has no method 'forEach'\"","user":{"login":"kurttheviking","id":815259,"avatar_url":"https://avatars.githubusercontent.com/u/815259?v=3","gravatar_id":"","url":"https://api.github.com/users/kurttheviking","html_url":"https://github.com/kurttheviking","followers_url":"https://api.github.com/users/kurttheviking/followers","following_url":"https://api.github.com/users/kurttheviking/following{/other_user}","gists_url":"https://api.github.com/users/kurttheviking/gists{/gist_id}","starred_url":"https://api.github.com/users/kurttheviking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kurttheviking/subscriptions","organizations_url":"https://api.github.com/users/kurttheviking/orgs","repos_url":"https://api.github.com/users/kurttheviking/repos","events_url":"https://api.github.com/users/kurttheviking/events{/privacy}","received_events_url":"https://api.github.com/users/kurttheviking/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-08-26T20:00:58Z","updated_at":"2015-02-07T19:52:29Z","closed_at":"2015-02-07T19:52:29Z","body":"using minq 1, rc 8; ubuntu 14.04; node 0.10.26; npm 1.4.3\r\n\r\n### setup\r\n\r\n```\r\nvar connstr = process.env.DB_CONN_STRING;\r\nvar minq = require('minq');\r\n\r\nminq.connect(connstr).then(function (db) {\r\n  console.log('connected: ' + connstr);\r\n\r\n  return db\r\n    .from('CollectionName')\r\n    .forEach(function (data) {\r\n       console.log(data);\r\n    });\r\n})\r\n.then(function () {\r\n  console.log('done');\r\n});\r\n```\r\n\r\n### expected\r\n\r\na log of each item in the collection\r\n\r\n```\r\n> {}\r\n> {}\r\n...\r\n```\r\n\r\n### actual\r\n\r\n```\r\nTypeError: Object #<Object> has no method 'forEach'\r\n    at /home/test.js:23:15\r\n    at Writable.stream._write (/home/node_modules/minq/node_modules/charybdis/index.js:51:14)\r\n    at doWrite (_stream_writable.js:226:10)\r\n    at writeOrBuffer (_stream_writable.js:216:5)\r\n    at Writable.write (_stream_writable.js:183:11)\r\n    at Stream.ondata (stream.js:51:26)\r\n    at Stream.EventEmitter.emit (events.js:95:17)\r\n    at drain (/home/node_modules/minq/node_modules/through/index.js:36:16)\r\n    at Stream.stream.queue.stream.push (/home/node_modules/minq/node_modules/through/index.js:45:5)\r\n    at Stream.<anonymous> (/home/node_modules/minq/mongodb.js:85:50)\r\n```\r\n\r\n\r\n### notes\r\n\r\ninterestingly, if you add a `select(['_id'])` it works fine; however if you add any other element to the select, it fails with the same error"},"comment":{"url":"https://api.github.com/repos/jden/minq/issues/comments/73379946","html_url":"https://github.com/jden/minq/issues/17#issuecomment-73379946","issue_url":"https://api.github.com/repos/jden/minq/issues/17","id":73379946,"user":{"login":"jden","id":1106489,"avatar_url":"https://avatars.githubusercontent.com/u/1106489?v=3","gravatar_id":"","url":"https://api.github.com/users/jden","html_url":"https://github.com/jden","followers_url":"https://api.github.com/users/jden/followers","following_url":"https://api.github.com/users/jden/following{/other_user}","gists_url":"https://api.github.com/users/jden/gists{/gist_id}","starred_url":"https://api.github.com/users/jden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jden/subscriptions","organizations_url":"https://api.github.com/users/jden/orgs","repos_url":"https://api.github.com/users/jden/repos","events_url":"https://api.github.com/users/jden/events{/privacy}","received_events_url":"https://api.github.com/users/jden/received_events","type":"User","site_admin":false},"created_at":"2015-02-07T19:52:29Z","updated_at":"2015-02-07T19:52:29Z","body":"Okay, the specific TypeError is from the version of v8 in node 0.10.26 (v8 3.14.5.9). In newer v8s it's a \"x is not a function\" message.\r\n\r\nI'm going to close this issue."}}