能否在 think\mongo\Query 的驱动中增加一个 findAndModify 方法

浏览:679 发布日期:2017/01/10 分类:ThinkPHP5专区 关键字: mongo thinkphp5
think\mongo\Query 就 mongodb 的驱动来说 THINKPHP已经做的相当好了,比如 find insert insertall 等等,能否在该驱动中添加一个 findAndModify 方法,该查询命令在 mongodb 3.2 后才有的,功能比较强大。db.collection.findAndModify({
    query: <document>,
    sort: <document>,
    remove: <boolean>,
    update: <document>,
    new: <boolean>,
    fields: <document>,
    upsert: <boolean>,
    bypassDocumentValidation: <boolean>,
    writeConcern: <document>,
    collation: <document>
});
如果能将这个命令变成驱动的一个方法,这样能灵活的多,比如可以使用该方法实现 mongoDb 的模拟事务等等。

我的水平太差了,希望 liu21st 老大 能帮忙写一下
最佳答案
评论( 相关
后面还有条评论,点击查看>>