Table of Contents
浏览器打开开发好的网页的时候报错:Caused by: SyntaxError: Unexpected identifier
本篇博客主要是收集一些编程时遇到的典型的代码方面的bug,包括前端后端以及数据库。
后端
把不必要的数据库操作放到了for循环里面做
一个真实发生在我们的产品里的例子,伪代码如下:
public ResponseEntity<List<PubCustomer>> getAllCustomer(String expand, String q, Integer pageSize,Integer pageNumber, String... sortBy) {
...
Iterable<BP> bpCustomer = bpRepository.findAll(queryConditions, pageRequest);
...
if (bpCustomer != null) {
bpCustomer.forEach(bp -> {
...
if (allExpandParamStatus.get(DEFAULT_ADDRESS) || allExpandParamStatus.get("all")) {
Address defauleAddress = addressRepository.findByOwnerIdAndIsDefault(bp.getPkId(), true);
customer.setD

这篇博客整理了编程中常见的错误,包括后端将数据库操作置于for循环内导致效率低下,spring cloud vault启动时token为空的异常,前端JavaScript语法错误,以及MongoDB排序超过32MB限制的问题。对于这些问题,提供了相应的解决方案和参考资料。
最低0.47元/天 解锁文章

1762

被折叠的 条评论
为什么被折叠?



