Spring Data JPA-Mongo DB:回复消息长度5502322小于最大消息长度

问题描述 投票:0回答:1

代码:

Interface::

@Query(value = "{'status': {$in: ?0} , 'date':{ $lte: ?1 }}")
List<Blog> findByStatusAndCurrentDateWithOrdering(List<String> status, Date date, Sort order);

Calling Class:

findByStatusAndCurrentDateWithOrdering(status, new Date(), Sort.by(Direction.DESC, "date")

来自在Azure中部署的应用程序的错误:

"status": 500,
    "error": "Internal Server Error",
    "message": "The reply message length 5502322 is less than the maximum message length 4194304; nested exception is com.mongodb.MongoIn
ternalException: The reply message length 5502322 is less than the maximum message length 4194304",

MongoDB中的内容包括Base64图像以及ID,HTML。 (并且只有11或12行)

客户的Azure Mongo DB版本为<3.2.0。本地为> 3.2

在上面的代码中可以进行哪些更改以成块读取或限制使其正常工作?

mongodb azure spring-data-jpa spring-data-mongodb
1个回答
0
投票

您需要更改为此:

db.blog.aggregate([
    {$match:{"status": {$in: status} , "date":{ $lte: date }}},
    {$sort:{"date":-1}}
],{allowDiskUse:true})
© www.soinside.com 2019 - 2024. All rights reserved.