在 Meteor/React 中实现可撤销的 MongoDB 事务

Implement undoable MongoDB transaction in Meteor/React

在我的 app 中,我有一个从 MongoDB 加载的 table,它允许用户进行在线编辑。

目前,我只是订阅数据库并直接将更改发送到那里。这排除了任何类型的撤消操作,但它使状态更改变得异常容易。

我可以将最后 3 个操作存储在堆栈上,并在按下撤消按钮时应用相反的操作,但我想知道 Mongo/Meteor 中是否有正确的方法来做到这一点?

您可能会发现以下解决方案之一有帮助:

https://atmospherejs.com/babrahams/transactions

https://atmospherejs.com/adain/meteor-command-pattern