I have this special case, where a customer requires a specific (legacy) format of booking numbers, the first one starts with the current year: 2015-12345 So basically every year I would have to start from 0
The other one is starting with a foreign-key: 7-123 So the first document created by every the user gets number 1, and so on.
Unfortunately there will be long lists starting with this booking number, so fetching all the records and calculating the booking number is not really an option. I have also thought about overriding the save() method, reading and auto-incrementing manually, but what about simultaneous inserts?