方法1

 

DBObject dbObject = new BasicDBObject();

dbObject.put("status", 1);

DBObject fieldObject = new BasicDBObject();

fieldObject.put("catalogName", true);

fieldObject.put("_id", true);

Query query = new BasicQuery(dbObject, fieldObject);

return MongoPagebleUtil.queryAndPagable(query, pageable, getMongoOperations(), ForeCatalog.class);

 

 

方法2

 

@Query(value = "{'status':?0 }", fields = "{ '_id' : 1, 'catalogName' : 1}")

List<ForeCatalog> findAllForeCatalogIdAndName(String status);

相关文章:

  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-15
  • 2022-12-23
  • 2021-06-02
  • 2021-10-31
  • 2021-04-30
相关资源
相似解决方案