{"action":"created","issue":{"url":"https://api.github.com/repos/OpenUserJs/OpenUserJS.org/issues/349","labels_url":"https://api.github.com/repos/OpenUserJs/OpenUserJS.org/issues/349/labels{/name}","comments_url":"https://api.github.com/repos/OpenUserJs/OpenUserJS.org/issues/349/comments","events_url":"https://api.github.com/repos/OpenUserJs/OpenUserJS.org/issues/349/events","html_url":"https://github.com/OpenUserJs/OpenUserJS.org/issues/349","id":42943532,"number":349,"title":"Script.created","user":{"login":"Zren","id":416367,"avatar_url":"https://avatars.githubusercontent.com/u/416367?v=3","gravatar_id":"","url":"https://api.github.com/users/Zren","html_url":"https://github.com/Zren","followers_url":"https://api.github.com/users/Zren/followers","following_url":"https://api.github.com/users/Zren/following{/other_user}","gists_url":"https://api.github.com/users/Zren/gists{/gist_id}","starred_url":"https://api.github.com/users/Zren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zren/subscriptions","organizations_url":"https://api.github.com/users/Zren/orgs","repos_url":"https://api.github.com/users/Zren/repos","events_url":"https://api.github.com/users/Zren/events{/privacy}","received_events_url":"https://api.github.com/users/Zren/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OpenUserJs/OpenUserJS.org/labels/DB","name":"DB","color":"006b75"},{"url":"https://api.github.com/repos/OpenUserJs/OpenUserJS.org/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/OpenUserJs/OpenUserJS.org/labels/mightfix","name":"mightfix","color":"6E6E6E"},{"url":"https://api.github.com/repos/OpenUserJs/OpenUserJS.org/labels/needs%20testing","name":"needs testing","color":"2EFEF7"},{"url":"https://api.github.com/repos/OpenUserJs/OpenUserJS.org/labels/UI","name":"UI","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2014-09-16T22:52:15Z","updated_at":"2015-08-07T07:43:57Z","closed_at":null,"body":"With MongoDB. `_id: { type: ObjectId }` (which is the default id type) is made up of a timestamp of when the object was created (plus a few other things to make it unique across servers when you distribute the db). We can use it right now to fetch the creation date of scripts and other models.\r\n\r\nIt's currently possible to sort by creation date like so:\r\nhttps://openuserjs.org/?orderBy=_id&orderDir=asc\r\n\r\nTo display it, we can use `_id.getTimestamp()`, but I think making a virtual property `BaseSchema.created` would be best."},"comment":{"url":"https://api.github.com/repos/OpenUserJs/OpenUserJS.org/issues/comments/128625308","html_url":"https://github.com/OpenUserJs/OpenUserJS.org/issues/349#issuecomment-128625308","issue_url":"https://api.github.com/repos/OpenUserJs/OpenUserJS.org/issues/349","id":128625308,"user":{"login":"Zren","id":416367,"avatar_url":"https://avatars.githubusercontent.com/u/416367?v=3","gravatar_id":"","url":"https://api.github.com/users/Zren","html_url":"https://github.com/Zren","followers_url":"https://api.github.com/users/Zren/followers","following_url":"https://api.github.com/users/Zren/following{/other_user}","gists_url":"https://api.github.com/users/Zren/gists{/gist_id}","starred_url":"https://api.github.com/users/Zren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zren/subscriptions","organizations_url":"https://api.github.com/users/Zren/orgs","repos_url":"https://api.github.com/users/Zren/repos","events_url":"https://api.github.com/users/Zren/events{/privacy}","received_events_url":"https://api.github.com/users/Zren/received_events","type":"User","site_admin":false},"created_at":"2015-08-07T07:43:57Z","updated_at":"2015-08-07T07:43:57Z","body":"Virtual functions aren't serialized into the db, nor are their calculated values, ergo you can't query over them.\r\n\r\nhttp://mongoosejs.com/docs/guide.html#virtuals"}}