I am trying to use the document versioning pattern follow https://www.mongodb.com/blog/post/building-with-patterns-the-document-versioning-pattern. I can’t make the revision successfully work. I set the revision in the document but everytime I update the doc the revision doesn’t upgrade and there is no duplicated documents to store the older version. I searched from Internet but can’t find a workable tutorial, can anyone give help? Many thanks!
How are you updating the document ? Could you provide:
- Example document
- Example code snippet
- Example update operation
- Expected outcome
The implementation depends on your requirements and use case. The blog post gave an example of storing into two collections, but depending on the use case you could also store in one collection.