anwena / MongoPlus

🔥🔥🔥使用MyBatisPlus的方式,优雅的操作MongoDB
Apache License 2.0
112 stars 12 forks source link

com.anwen.mongo.mapper.DefaultBaseMapperImpl的update,文档没有修改会返回更新失败,应该再加一个判断更严谨 #8

Open 1131292790 opened 4 months ago

1131292790 commented 4 months ago
    @Override
    public Long update(Bson queryBasic, Bson updateBasic, Class<?> clazz) {
        UpdateResult result  = factory.getExecute().executeUpdate(
                queryBasic,
                updateBasic,
                `mongoPlusClient.getCollection(clazz)`
        );
      return result.getModifiedCount()==0 && result.getMatchedCount() == 0;
    }