【发布时间】:2020-11-29 18:55:51
【问题描述】:
当我有一个嵌套查询时,我在 DexieJS 上遇到了一个问题。以下是我的代码示例:-
let id = 1;
let child = db.child.where({ id : result.child_id }).first( item => item ).catch( e => "NotFoundError"; );
console.log(child); // success, it shows the child item
db.parent.where({ id : id }).each( parent => {
let child = db.child.where({ id : parent.id }).first( item => item ).catch( e => "NotFoundError"; );
console.log(child); // it will show NotFoundError
});
不知道发生了什么,嵌套查询在 DexieJS 上不起作用,我毫不怀疑它应该起作用。
请指教,提前谢谢。
【问题讨论】: