{"action":"created","issue":{"url":"https://api.github.com/repos/lfergon/meteor-export-csv/issues/7","labels_url":"https://api.github.com/repos/lfergon/meteor-export-csv/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/lfergon/meteor-export-csv/issues/7/comments","events_url":"https://api.github.com/repos/lfergon/meteor-export-csv/issues/7/events","html_url":"https://github.com/lfergon/meteor-export-csv/issues/7","id":122958750,"number":7,"title":"Ordering of fields","user":{"login":"tweakitguy","id":3307421,"avatar_url":"https://avatars.githubusercontent.com/u/3307421?v=3","gravatar_id":"","url":"https://api.github.com/users/tweakitguy","html_url":"https://github.com/tweakitguy","followers_url":"https://api.github.com/users/tweakitguy/followers","following_url":"https://api.github.com/users/tweakitguy/following{/other_user}","gists_url":"https://api.github.com/users/tweakitguy/gists{/gist_id}","starred_url":"https://api.github.com/users/tweakitguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tweakitguy/subscriptions","organizations_url":"https://api.github.com/users/tweakitguy/orgs","repos_url":"https://api.github.com/users/tweakitguy/repos","events_url":"https://api.github.com/users/tweakitguy/events{/privacy}","received_events_url":"https://api.github.com/users/tweakitguy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"lfergon","id":1398298,"avatar_url":"https://avatars.githubusercontent.com/u/1398298?v=3","gravatar_id":"","url":"https://api.github.com/users/lfergon","html_url":"https://github.com/lfergon","followers_url":"https://api.github.com/users/lfergon/followers","following_url":"https://api.github.com/users/lfergon/following{/other_user}","gists_url":"https://api.github.com/users/lfergon/gists{/gist_id}","starred_url":"https://api.github.com/users/lfergon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lfergon/subscriptions","organizations_url":"https://api.github.com/users/lfergon/orgs","repos_url":"https://api.github.com/users/lfergon/repos","events_url":"https://api.github.com/users/lfergon/events{/privacy}","received_events_url":"https://api.github.com/users/lfergon/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-12-18T14:34:15Z","updated_at":"2015-12-18T15:01:52Z","closed_at":null,"body":"It appears as if my mongo collection does not have an identical order of fields returned for each record that the CSV output is incorrect."},"comment":{"url":"https://api.github.com/repos/lfergon/meteor-export-csv/issues/comments/165798611","html_url":"https://github.com/lfergon/meteor-export-csv/issues/7#issuecomment-165798611","issue_url":"https://api.github.com/repos/lfergon/meteor-export-csv/issues/7","id":165798611,"user":{"login":"tweakitguy","id":3307421,"avatar_url":"https://avatars.githubusercontent.com/u/3307421?v=3","gravatar_id":"","url":"https://api.github.com/users/tweakitguy","html_url":"https://github.com/tweakitguy","followers_url":"https://api.github.com/users/tweakitguy/followers","following_url":"https://api.github.com/users/tweakitguy/following{/other_user}","gists_url":"https://api.github.com/users/tweakitguy/gists{/gist_id}","starred_url":"https://api.github.com/users/tweakitguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tweakitguy/subscriptions","organizations_url":"https://api.github.com/users/tweakitguy/orgs","repos_url":"https://api.github.com/users/tweakitguy/repos","events_url":"https://api.github.com/users/tweakitguy/events{/privacy}","received_events_url":"https://api.github.com/users/tweakitguy/received_events","type":"User","site_admin":false},"created_at":"2015-12-18T15:01:52Z","updated_at":"2015-12-18T15:01:52Z","body":"It doesn't appear to be an issue with null fields.  Depending on what order my data gets initialized I may have one record that appears as such:\r\nColumn 1\r\nColumn 2\r\nColumn 3\r\n\r\nHowever the next item may be stored in Mongo as\r\nColumn 2\r\nColumn 1\r\nColumn 3\r\n\r\nIn this case, the CSV output data is not valid.  \r\n| Column 1 | Column 2 | Column 3 |\r\n| Column 2 | Column 1 | Column 3 |\r\n\r\nI'm looking at two possible work arounds right now:\r\n1. Make sure that all columns are initialized in Mongo collection even if no data exists\r\n2. Attempt to re-order the collection before it is parsed into the CSV exporter"}}