Update history for a document

85 views
Skip to first unread message

Aakash Deep

unread,
Mar 7, 2016, 3:12:02 AM3/7/16
to MongoEngine Users
Hi,

Is there an existing way to get the update history and save it in a history database.
For example: There is an order document, which gets edited by multiple entities and for now I am doing a manual save in the history collection whenever the order document is edited. 
1. I was wondering is there a better way to do this?
2. Is there a way to just store the diff?

TIA.

-Aakash

Melike Sahin

unread,
Jul 26, 2019, 3:49:57 AM7/26/19
to MongoEngine Users
Hi, you can look at change streams in mongodb and this blog may help.

Also you can watch updates on a collection with pymongo db.collection_name.watch()  function.

Thanks,
- Melike
Reply all
Reply to author
Forward
0 new messages