News for hackers. Stuff that matters.
Re:MongoDB interactive tutorial by harryh on Wednesday March 16, 2011 @06:00AM (#2331446)
In the real world you probably wouldn't want to have a dob field on the unicorns table. Instead just use the timestamp embedded into the _id field.

Pretty good overall though.

Re:MongoDB interactive tutorial by praptak on Wednesday March 16, 2011 @11:10AM (#2332323)
"In the real world you probably wouldn't want to have a dob field on the unicorns table. Instead just use the timestamp embedded into the _id field."

The real world unicorns are not born on the same second that their db record is created.

Re:MongoDB interactive tutorial by ethangunderson on Wednesday March 16, 2011 @11:43AM (#2332458)
The issue with that is if your DB gets backed and starts queuing writes, the timestamps will be skewed. Obviously this isn't always a show stopper, but a caveat nonetheless.
Re:MongoDB interactive tutorial by mathias_10gen on Wednesday March 16, 2011 @12:39PM (#2332719)
Actually the _id is usually created client-side so the timestamp will reflect when the application created the object rather than when it was processed by the DB. The only major exception is when the DB creates the _id for an upsert.