事情起因是:
采用jql写法进行3张表联查,前面几天开发都正常,从22号发现,2张副表只能查出来一张(外键都设置相同)。
唯一的印象就是对主表和其中一个副表进行过数据导出操作,这个操作应该不至于吧?检测代码也没发现问题。
于是改用聚合操作写法试试:
其他都正常,唯独 sample({size: 160 }) ,size 设置超过200,云对象返回:Unable to get object content
当 size:150 正常返回的时候大概10万个字符,100多kb,也不大啊?
有没有大佬知道原因啊?
yukio
- 发布:2025-01-23 00:49
- 更新:2025-01-24 02:13
- 阅读:90
yukio (作者) - yukio
const dbCmd = dbjql.command;
const $ = dbCmd.aggregate;
const res = await dbjql.collection('questions')
.aggregate()
.lookup({
from: 'options',
let: {
question_id: '$question_id'
},
pipeline: $.pipeline()
.match(dbCmd.expr(
$.eq(['$question_id', '$$question_id'])
))
.project({
code: true,
content: true,
is_correct: true
})
.done(),
as: 'options'
})
.lookup({
from: 'user_collect',
let: {
question_id: '$question_id'
},
pipeline: $.pipeline()
.match(dbCmd.expr(
$.eq(['$question_id', '$$question_id'])
))
.project({
bank_id: true,
user_id: true,
question_id: true
})
.done(),
as: 'user_collect'
})
.match(where_obj).sample({
size: 200
})
.project({
bank_id: true,
status: true,
title: true,
type_id: true,
type_enum: true,
question_id: true,
options: true,
user_collect: true
}).end();
return res.data;
yukio (作者)
试了阿里云和支付宝4.5,请求稍微大一点,都出现了{"errCode": "SYSTEM_ERROR","errMsg": "Unable to get object content"},控制台有慢日志出现,索引也加了,表以及数据都删了重新测试都无解
2025-01-24 02:06
风之源
回复 yukio: 这个提示一般是本地无法展示,数据实际读出来了,你可以只打印data[0]
2025-01-25 21:25