ObjectId objID = new ObjectId("主键id");
Query query=new Query(Criteria.where("_id").is(objID).and("status").is(1));
Menu _menu= mongoTemplate.findOne(query,Menu.class);
ObjectId objID = new ObjectId("主键id");
Query query=new Query(Criteria.where("_id").is(objID).and("status").is(1));
Menu _menu= mongoTemplate.findOne(query,Menu.class);
本文标题:关于ObjectId查询
本文链接:https://www.haomeiwen.com/subject/jzjjlftx.html
网友评论