SqlSugar.MongoDbCore后续是否有支持原生mongodb ReturnDocument.After的计划 返回

SqlSugar 沟通中
6 559
该叫什么 Gris 发布于1周前
悬赏:0 飞吻

如题, 使用 MongoDB.Driver 库的写法如下:


var filter = Builders<Foo>.Filter.Eq(x => x.Id, id);
var update = Builders<Foo>.Update.Set(x => x.Deleted, 1);
var options = new FindOneAndUpdateOptions<Foo>
{
    IsUpsert = true,
    ReturnDocument = ReturnDocument.After
};
var updateResult = await collection.FindOneAndUpdateAsync(filter, update, options);


执行后可以直接获取更新后的数据.


目前 SqlSugar.MongoDbCore 中, 更新部分似乎只支持 ExecuteCommandAsync(), 而插入部分支持 ExecuteReturnEntityAsync() 方法.


热忱回答6

  • 好的我支持一下。

    0 回复
  • db.Updateable(data).execommand()

    你直接返回data不行吗。 好像没必要

    0 回复
  • Gris Gris VIP0
    1周前

    @fate sta:也可以, 现在就是这么做的, 只是想问一下有没有支持这个特性的计划, 没有的话我就继续这样写了

    0 回复
  • @Gris:好的。我支持一下

    0 回复
  • SqlSugarCore 5.1.4.198-preview08

    勾一下预览已支持

    0 回复
  • Gris Gris VIP0
    6天前

    感谢支持! 

    0 回复