Recommendation for document version field?

I’m fairly new to document databases. 25 years on relational. In relational, you could count on the model changing at some point. DDL change script in Dev. Test. Staging. Release to Prod. Done.
Here in MongoDB, I understand you simply insert into collection X a document with a different shape. But in order not to leave a steaming pile of different documents, I understand it is wise to use a field to version the schema kept in the collection. Then the code has to have logic control to handle the version differences.

What are your recommendations for a schema versioning field, something that has worked well for you? As in:
field name?
field datatype as number or string?
if string, what format or numbering scheme within the string has worked well for you?

Some reading at Building with Patterns: The Schema Versioning Pattern | MongoDB Blog.

Although, I do not use mongoose, I know they use __v as the schema version field name. I like that as it start with _ like _id and used the same name.

In the blog I shared, they used schema_version which I found too verbose.

You want to use something that you can easily match related code. With git it could be a commit number, a branch, a tag …

I like a value that increases so that if document:__v is smaller than code:__v, I know I might need to update.

2 Likes