簡體   English   中英

引用數組中的健全性查詢

[英]Sanity query in an array of references

我有一系列帶有引用標簽的文章:

_type: "article",
tags: [
 {
   _id: "123",
   _rev: "123",
   _type: "articleTag",
   key: { _type: "slug", current: "news" },
   title: "News",
   _type: "string" 
 },
 ...
],

嘗試創建所有文章的查詢包含多個標簽的數組:

*[ _type == "article" && tags[].key.current in *["news, news2"]._id ]{...,"tags": tags[]->}

但是我收到錯誤消息: No function in() defined for arguments (array, array)

*[ _type == "article" && ("news" in tags[]->key.current || "news2" in tags[]->key.current)]{...,"tags": tags[]->}

我很快就得到了sanity-io-land 的幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM