【发布时间】:2022-11-11 18:49:14
【问题描述】:
我正在建立一个类似 cmets 的系统,其中 cmets 有一个与另一条评论相关的 parent 字段。我希望能够通过查找没有设置 parent 的 cmets 来查询顶级评论,但我在文档中看不到任何方法来做到这一点。
我试过这个,但看起来$null 过滤器不适用于连接。
const posts = await strapi.entityService.findMany('api::post.post', {
filters: {
thread: {
id: {
$eq: entity[0].id,
}
},
parent: {
$null: true,
}
}
});
我得到了错误:只有 $and、$or 和 $not 可以用作根级运算符。发现 $null。
我在 Strapi 文档中找不到任何关于此的内容,但这似乎是一件非常标准的事情。
【问题讨论】: