模糊查詢 regex(".*?\\"+questionContent+".*")spa
String questionContent = "需求"; Query query = new Query(); query.addCriteria(Criteria.where("demandName").regex(".*?\\"+questionContent+".*")); System.out.println(mongo.count(query, AdvTrusteeship.class));