我想获得所有包含 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
我做错了什么?