There is an article here that describes how to setup an auto increment on save using database triggers. Basically it uses a separate counter collection, similar to what @AndrewL suggests, to track the value and updates the document on insert
https://www.mongodb.com/resources/products/platform/mongodb-auto-increment