org.springframework.data.mongodb.core.query.Criteria.in()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(174)

本文整理了Java中org.springframework.data.mongodb.core.query.Criteria.in()方法的一些代码示例,展示了Criteria.in()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Criteria.in()方法的具体详情如下:
包路径:org.springframework.data.mongodb.core.query.Criteria
类名称:Criteria
方法名:in

Criteria.in介绍

[英]Creates a criterion using the $in operator.
[中]使用$in运算符创建条件。

代码示例

代码示例来源:origin: roncoo/spring-boot-demo

public RoncooUser selectById(int id) {
    Criteria criteria = Criteria.where("id").in(id);
    Query query = new Query(criteria);
    return mongoTemplate.findOne(query, RoncooUser.class);
  }
}

代码示例来源:origin: roncoo/spring-boot-demo

public void deleteById(int id) {
  Criteria criteria = Criteria.where("id").in(id);
  Query query = new Query(criteria);
  mongoTemplate.remove(query, RoncooUser.class);
}

代码示例来源:origin: roncoo/spring-boot-demo

public void deleteById(int id) {
  Criteria criteria = Criteria.where("id").in(id);
  Query query = new Query(criteria);
  mongoTemplate.remove(query, RoncooUser.class);
}

代码示例来源:origin: roncoo/spring-boot-demo

public void deleteById(int id) {
  Criteria criteria = Criteria.where("id").in(id);
  Query query = new Query(criteria);
  mongoTemplate.remove(query, RoncooUser.class);
}

代码示例来源:origin: roncoo/spring-boot-demo

public void deleteById(int id) {
  Criteria criteria = Criteria.where("id").in(id);
  Query query = new Query(criteria);
  mongoTemplate.remove(query, RoncooUser.class);
}

代码示例来源:origin: roncoo/spring-boot-demo

public void deleteById(int id) {
  Criteria criteria = Criteria.where("id").in(id);
  Query query = new Query(criteria);
  mongoTemplate.remove(query, RoncooUser.class);
}

代码示例来源:origin: roncoo/spring-boot-demo

public void deleteById(int id) {
  Criteria criteria = Criteria.where("id").in(id);
  Query query = new Query(criteria);
  mongoTemplate.remove(query, RoncooUser.class);
}

代码示例来源:origin: roncoo/spring-boot-demo

public void deleteById(int id) {
  Criteria criteria = Criteria.where("id").in(id);
  Query query = new Query(criteria);
  mongoTemplate.remove(query, RoncooUser.class);
}

代码示例来源:origin: roncoo/spring-boot-demo

public RoncooUser selectById(int id) {
    Criteria criteria = Criteria.where("id").in(id);
    Query query = new Query(criteria);
    return mongoTemplate.findOne(query, RoncooUser.class);
  }
}

代码示例来源:origin: roncoo/spring-boot-demo

public RoncooUser selectById(int id) {
    Criteria criteria = Criteria.where("id").in(id);
    Query query = new Query(criteria);
    return mongoTemplate.findOne(query, RoncooUser.class);
  }
}

代码示例来源:origin: roncoo/spring-boot-demo

public void deleteById(int id) {
  Criteria criteria = Criteria.where("id").in(id);
  Query query = new Query(criteria);
  mongoTemplate.remove(query, RoncooUser.class);
}

代码示例来源:origin: roncoo/spring-boot-demo

public RoncooUser selectById(int id) {
    Criteria criteria = Criteria.where("id").in(id);
    Query query = new Query(criteria);
    return mongoTemplate.findOne(query, RoncooUser.class);
  }
}

代码示例来源:origin: roncoo/spring-boot-demo

public RoncooUser selectById(int id) {
    Criteria criteria = Criteria.where("id").in(id);
    Query query = new Query(criteria);
    return mongoTemplate.findOne(query, RoncooUser.class);
  }
}

代码示例来源:origin: roncoo/spring-boot-demo

public RoncooUser selectById(int id) {
    Criteria criteria = Criteria.where("id").in(id);
    Query query = new Query(criteria);
    return mongoTemplate.findOne(query, RoncooUser.class);
  }
}

代码示例来源:origin: roncoo/spring-boot-demo

public void updateById(RoncooUser roncooUser) {
  Criteria criteria = Criteria.where("id").in(roncooUser.getId());
  Query query = new Query(criteria);
  Update update = new Update();
  update.set("name", roncooUser.getName());
  update.set("createTime", roncooUser.getCreateTime());
  mongoTemplate.updateMulti(query, update, RoncooUser.class);
}

代码示例来源:origin: roncoo/spring-boot-demo

public void updateById(RoncooUser roncooUser) {
  Criteria criteria = Criteria.where("id").in(roncooUser.getId());
  Query query = new Query(criteria);
  Update update = new Update();
  update.set("name", roncooUser.getName());
  update.set("createTime", roncooUser.getCreateTime());
  mongoTemplate.updateMulti(query, update, RoncooUser.class);
}

代码示例来源:origin: roncoo/spring-boot-demo

public void updateById(RoncooUser roncooUser) {
  Criteria criteria = Criteria.where("id").in(roncooUser.getId());
  Query query = new Query(criteria);
  Update update = new Update();
  update.set("name", roncooUser.getName());
  update.set("createTime", roncooUser.getCreateTime());
  mongoTemplate.updateMulti(query, update, RoncooUser.class);
}

代码示例来源:origin: roncoo/spring-boot-demo

public void updateById(RoncooUser roncooUser) {
  Criteria criteria = Criteria.where("id").in(roncooUser.getId());
  Query query = new Query(criteria);
  Update update = new Update();
  update.set("name", roncooUser.getName());
  update.set("createTime", roncooUser.getCreateTime());
  mongoTemplate.updateMulti(query, update, RoncooUser.class);
}

代码示例来源:origin: roncoo/spring-boot-demo

public void updateById(RoncooUser roncooUser) {
  Criteria criteria = Criteria.where("id").in(roncooUser.getId());
  Query query = new Query(criteria);
  Update update = new Update();
  update.set("name", roncooUser.getName());
  update.set("createTime", roncooUser.getCreateTime());
  mongoTemplate.updateMulti(query, update, RoncooUser.class);
}

代码示例来源:origin: roncoo/spring-boot-demo

public void updateById(RoncooUser roncooUser) {
  Criteria criteria = Criteria.where("id").in(roncooUser.getId());
  Query query = new Query(criteria);
  Update update = new Update();
  update.set("name", roncooUser.getName());
  update.set("createTime", roncooUser.getCreateTime());
  mongoTemplate.updateMulti(query, update, RoncooUser.class);
}

相关文章