Query failed with error code 292 and error message 'Executor error during find command :: caused by :: Sort exceeded memory limit of 104857600 bytes, but did not opt in to external sorting. Aborting operation. Pass allowDiskUse:true to opt in.' on server 192.168.1.202:27017
at com.mongodb.internal.operation.FindOperation$1.call(FindOperation.java:635)
参考:https://blog.csdn.net/weixin_33446857/article/details/83504484
解决方法,根据哪个字段排序就根据哪个字段排序:
Sort sort = Sort.by(Sort.Direction.DESC, "createTime");
此时我建立了一个createTime的索引就好了