【发布时间】:2022-01-18 09:58:03
【问题描述】:
这是我在视觉中所做的事情
*[_type == "post" && categories == SOCIAL ]{
_id, title
}
返回
No documents found in dataset production that match query:
*[_type == "post" && categories == SOCIAL ]{
_id, title
}
【问题讨论】:
-
categories是可以包含字符串"SOCIAL"的数组吗?如果是这样,您必须使用in:*[_type == "post" && "SOCIAL" in categories]。 -
@AlexanderStaubo 在数据集生产中找不到与查询匹配的文档:*[_type == "post" && "SOCIAL" in categories]
-
categories是字符串数组吗? -
@AlexanderStaubo "result":[8 items 0:{6 items "_createdAt":"2021-12-15T05:14:53Z" "_id":"167d5d3e-ce1b-4f0c-a092- aa81213bed41" "_rev":"wY9KfPeCwmcMrJtIpsqdOq" "_type":"category" "_updatedAt":"2021-12-15T05:14:53Z" "title":"SOCIAL" }
-
所以它不是一个字符串数组。你需要这样写:
"SOCIAL" in categories[].title。但是,如果categories是一个引用数组,则需要这样编写:"SOCIAL" in categories[]->title。