【问题标题】:MongoDB Springboot Query annotation giving only first recordMongoDB Spring Boot Query 注释仅给出第一条记录
【发布时间】:2021-04-02 20:49:31
【问题描述】:

问题:对于 Spring Boot 和 MongoDB,@Query 注释只给出第一个结果而不是 Multiple expected 。

理想情况下,根据查询,我期望 5 条记录,但它只给我 1 条(第一个有效响应)。

这是我存储库中的代码:

@Query("{unixTimestamp : {$lt : ?0, $gt : ?1}}")
List<DataType> findAllByUnixTimeStampRange(long upperlimit, long lowerlimit);

【问题讨论】:

    标签: spring mongodb spring-boot annotations spring-data


    【解决方案1】:

    查询是否在 MongoDB 命令行上工作?

    如果不是,请检查您的查询,因为此问题不是由@Query 注释引起的

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-21
      • 1970-01-01
      • 1970-01-01
      • 2015-12-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多