The only problem with this method is that it requires that IDs are integers, start at 1 and increment by 1.
I'm using MongoDB and IDs are 12-byte values of which the first four are a timestamp. Does anyone know of a way to make this method work, ideally without adding another field to the collection?