分页查询数据的方法有点问题,由于每个分页是根据条件查询出全部的数据,再用数组进行切割来获取分页数据,如果表中的数据够多的话,会出现超过mongodb单次查询上限的异常。
该异常应该是由于sort只允许最大32MB的内存占用,如果条件查询出的数据超过了32MB则mongodb会抛出异常;
异常信息:
"Executor error during find command: OperationFailed: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit."
分页查询数据的方法有点问题,由于每个分页是根据条件查询出全部的数据,再用数组进行切割来获取分页数据,如果表中的数据够多的话,会出现超过mongodb单次查询上限的异常。 该异常应该是由于sort只允许最大32MB的内存占用,如果条件查询出的数据超过了32MB则mongodb会抛出异常; 异常信息: "Executor error during find command: OperationFailed: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit."