5 ms·
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
by harryh 16y ago
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.
- praptak 16y ago"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.
- ethangunderson 16y agoThe 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.
- mathias_10gen 16y agoActually 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.