mongodb加入事务支持,需要mongodb版本V4.0以上且开启复制集或分布式#98
Open
klinson wants to merge 2 commits intotop-think:masterfrom
Open
mongodb加入事务支持,需要mongodb版本V4.0以上且开启复制集或分布式#98klinson wants to merge 2 commits intotop-think:masterfrom
klinson wants to merge 2 commits intotop-think:masterfrom
Conversation
需要mongodb版本V4以上且开启复制集或分布式
事务内支持insert、update、delete、cmd等操作方式
支持无限级嵌套事务,但是外围事务回滚不影响内部事务的commit
```
Db::transaction(function () {
db()->table('users')->insert(['username' => 'test80']);
Db::startTrans();
db()->table('users')->where(['username' => 'test84'])->update(['sex' => 4]);
Db::commit();
});
```
Author
|
@liu21st 麻烦合并 |
Member
|
既然有版本限制 那就需要做一下低版本的兼容 还有属性命名不规范 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
需要mongodb版本V4以上且开启复制集或分布式
事务内支持insert、update、delete、cmd等操作方式
支持无限级嵌套事务,但是外围事务回滚不影响内部事务的commit