Giter VIP home page Giter VIP logo

Comments (11)

vinllen avatar vinllen commented on May 8, 2024

mongodb在4.0中对事务操作的namesapce是admin.$cmd,之前我们统一过滤掉admin库,这个的确是bug,目前没有对4.0进行事务上的支持。
这个功能有点复杂,对目前架构改动较大,我们会排期进行开发,在1.6版本发行出来。

from mongoshake.

glowwormX avatar glowwormX commented on May 8, 2024

现在写的mongo的Session应该还没有事务吧,我现在想先在写回数据库时把Object["applyOps"]数组拆分,根据op依次进行对应的操作,但是我又遇到类型转换的问题了,你还记得这个Object["applyOps"]是什么类型么,或者golang在断言的时候有什么办法能快速知道是什么类型

from mongoshake.

vinllen avatar vinllen commented on May 8, 2024

你这个oplog对应的操作不就是事务吗?
这个是bson.M,类型是interface{},断言是嵌套bson.M。golang的反射可以查看具体类型。

from mongoshake.

vinllen avatar vinllen commented on May 8, 2024

写回是什么意思?在目的库上自己进行拆分吗?你是想修改源码,对于事务操作自己拆分?

from mongoshake.

glowwormX avatar glowwormX commented on May 8, 2024

恩是的,目前连接mongo的客户端没有类似Session.beginTransaction( )这种事务支持吧?

from mongoshake.

vinllen avatar vinllen commented on May 8, 2024

事务是采用的applyOps方法进行操作的,你也可以直接采用用applyOps进行写入,不过会有写放大的问题,极端情况下会有问题。

from mongoshake.

glowwormX avatar glowwormX commented on May 8, 2024

能举个例子吗

from mongoshake.

vinllen avatar vinllen commented on May 8, 2024

用applyOps执行的oplog会包裹一层applyOps,相当于嵌套两层,执行多次就会嵌套多层。那么如果内层oplog已经达到上限,则加上外层的applyOps将会可能超过16MB的上限

from mongoshake.

glowwormX avatar glowwormX commented on May 8, 2024

比如事务里再用applyOps操作么,
另外用applyOps操作是否可以直接用你的CommandWriter.applyOps()

from mongoshake.

vinllen avatar vinllen commented on May 8, 2024
  1. 比如来回传递的情况,或者有链状传递,a->b->c->d,那么每传递一次都会放大一次
  2. 可以。singleWriter和batchWriter中应该都有的

from mongoshake.

vinllen avatar vinllen commented on May 8, 2024

这条issue将会被关闭,关于事务的疑问请关注 ISSUE89

from mongoshake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.