meteor/meteor — pull request #2285 by awatson1978 (2014-07-08 18:27:20+00:00)
Title: {idGeneration: 'TIMESTAMP'} and getTimestamp()

Hi all!
Have a small patch here to add a new idGeneration option: TIMESTAMP and to fix the objectID getTimestamp() functionality.

Useful for backwards compatibility with pre-existing MongoDB installations that have been created using _ids that contain timestamps. Meteor apps can play nicely with pre-existing Express apps using the same Mongo cluster, and write objects to shared collections that will display getTimestamp() results correctly in other apps.

While it doesn't solve the issue in #1834, it's closely related.

Additionally, I taught myself how to use TinyTest, so added +143 acceptance tests added to mongo-livedata test suite.

![screen shot 2014-07-08 at 11 15 42 am](https://cloud.githubusercontent.com/assets/675910/3512700/1ce34292-06bc-11e4-81ce-95950e55c2ce.png)

Also, I put together a sample application using this pull request demonstrating ``{{idGeneration:'TIMESTAMP'}} and ``getTimestamp()`` in action:

http://objectid-timestamp.meteor.com/
https://github.com/awatson1978/objectid-timestamp-test

Oh, and lastly, since the focus at MDG isn't really in supporting Express apps or 3rd party utilities that might benefit from ``{idGeneration:'TIMESTAMP'}`` functionality, instead of posting an Express example, here's a screenshot of Meteor-generated objectID which is producing a correct timestamp in Robomongo using getTimestamp().

![screen shot 2014-07-08 at 2 13 20 pm](https://cloud.githubusercontent.com/assets/675910/3514406/e3616444-06cb-11e4-8e3e-948792042053.png)

Anyhow, I hope I followed all the rules for submitting pull-requests correctly. This is my first one, so if I've missed anything, just let me know.
Thanks,
Abigail