如何解决Strapi - 按 DynamicZone 查询/过滤
我想获得所有包含 subjectInfo.__component = person
和 subjectInfo.gender = male
使用 nuxt $strapi 我已经试过了:
const res = await this.$strapi.find('reports',{
subjectInfo: {
__component: 'subject.person',gender: 'male'
}
})
但我得到了:
select `reports`.* from `reports` where `reports`.`type` = 'lost' and `reports`.`subjectInfo` = '[object Object]' and (`reports`.`published_at` is not null) limit 100 - sqlITE_ERROR: no such column: reports.subjectInfo
然后我尝试了:
const res = await this.$strapi.find('reports',[
['subjectInfo.__component','subject.person']
])
但它给了我 400 - 模型没有实体 subjectInfo.__component
我像这样切换到 $axios:
const query = qs.stringify({
_where: {
subjectInfo: {
__component: 'subject.person',gender: 'male'
}
}
})
const res = await this.$axios.$get(`http://localhost:1337/reports?${query}`)
但我收到了 500 - 内部服务器错误:
error Error: select `reports`.* from `reports` where `reports`.`subjectInfo` = {"__component":"subject.person","gender":"male"} and (`reports`.`published_at` is not null) limit 100 - sqlITE_ERROR: no such column: reports.subjectInfo
我做错了什么?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。