更新操作代码:
public void delete(MongoData mongoData) {
String sbj = mongoData.getSbj();
String prd = mongoData.getPrd();
String obj = mongoData.getObj();
//判断三个元素是否为空,都为空直接返回
if (StringUtils.isBlank(sbj) && StringUtils.isBlank(prd) && StringUtils.isBlank(obj)) {
return;
}
//更新位置
Update update = new Update();
update.set("delete", 1).set("update_time", DateUtil.DEFAULT_FORMATTER.format(LocalDateTime.now()))
.set("file_name", mongoData.getFile_name()).set("md5", mongoData.getMd5());
Criteria criteria = new Criteria();
if (StringUtils.isNotBlank(sbj)) {
criteria