{"action":"created","issue":{"url":"https://api.github.com/repos/DoSomething/northstar/issues/514","repository_url":"https://api.github.com/repos/DoSomething/northstar","labels_url":"https://api.github.com/repos/DoSomething/northstar/issues/514/labels{/name}","comments_url":"https://api.github.com/repos/DoSomething/northstar/issues/514/comments","events_url":"https://api.github.com/repos/DoSomething/northstar/issues/514/events","html_url":"https://github.com/DoSomething/northstar/pull/514","id":195320971,"number":514,"title":"Correctly cast dates when saving to MongoDB.","user":{"login":"DFurnes","id":583202,"avatar_url":"https://avatars.githubusercontent.com/u/583202?v=3","gravatar_id":"","url":"https://api.github.com/users/DFurnes","html_url":"https://github.com/DFurnes","followers_url":"https://api.github.com/users/DFurnes/followers","following_url":"https://api.github.com/users/DFurnes/following{/other_user}","gists_url":"https://api.github.com/users/DFurnes/gists{/gist_id}","starred_url":"https://api.github.com/users/DFurnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DFurnes/subscriptions","organizations_url":"https://api.github.com/users/DFurnes/orgs","repos_url":"https://api.github.com/users/DFurnes/repos","events_url":"https://api.github.com/users/DFurnes/events{/privacy}","received_events_url":"https://api.github.com/users/DFurnes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-13T17:44:53Z","updated_at":"2016-12-13T18:48:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/DoSomething/northstar/pulls/514","html_url":"https://github.com/DoSomething/northstar/pull/514","diff_url":"https://github.com/DoSomething/northstar/pull/514.diff","patch_url":"https://github.com/DoSomething/northstar/pull/514.patch"},"body":"#### What's this PR do?\r\nThis fixes an issue where date fields (e.g. `created_at`, `updated_at`, `birthdate`) were being stored as ISO-8601 strings rather than `ISODate` objects. This meant that we couldn't query for date ranges with Mongo (\"find me records made between these dates!\") which is needed for data analysis.\r\n\r\nFixes #513. References #479.\r\n\r\n#### How should this be reviewed?\r\nI added a test in acaf5d7 which demonstrates the problem (it will fail since there isn't a record with a casted date). The fix in 0a8d169 fixes the problem (and the failing test!) by correctly casting dates in the base model class.\r\n\r\n#### Checklist\r\n- [ ] Documentation added for changed endpoints.\r\n- [x] Tests added for new features/bug fixes.\r\n- [ ] Post a message in #api if this includes something that causes a rebuild!  "},"comment":{"url":"https://api.github.com/repos/DoSomething/northstar/issues/comments/266825838","html_url":"https://github.com/DoSomething/northstar/pull/514#issuecomment-266825838","issue_url":"https://api.github.com/repos/DoSomething/northstar/issues/514","id":266825838,"user":{"login":"DFurnes","id":583202,"avatar_url":"https://avatars.githubusercontent.com/u/583202?v=3","gravatar_id":"","url":"https://api.github.com/users/DFurnes","html_url":"https://github.com/DFurnes","followers_url":"https://api.github.com/users/DFurnes/followers","following_url":"https://api.github.com/users/DFurnes/following{/other_user}","gists_url":"https://api.github.com/users/DFurnes/gists{/gist_id}","starred_url":"https://api.github.com/users/DFurnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DFurnes/subscriptions","organizations_url":"https://api.github.com/users/DFurnes/orgs","repos_url":"https://api.github.com/users/DFurnes/repos","events_url":"https://api.github.com/users/DFurnes/events{/privacy}","received_events_url":"https://api.github.com/users/DFurnes/received_events","type":"User","site_admin":false},"created_at":"2016-12-13T18:48:08Z","updated_at":"2016-12-13T18:48:08Z","body":"Confirming that we just double-checked that IRL and it works as expected! ✅ "}}
{"actor":{"display_login":"DFurnes"}}