有没有办法过滤掉文字和引用的空值
Is there a way to filter out null values for literals and references
如果我们有一个没有文章信标的作者,因此 WroteArticles 为空,我们只想 return 有 non-empty/non-null 的作者 WroteArticles,这怎么可能?
作为示例,我们可以使用 Weaviate demo site
我尝试过使用 where 和各种 运算符 进行过滤操作,但我一定遗漏了一些明显的东西。下面是我在自己的数据集上尝试过的查询示例,其中我确实有一个没有信标的 Thing。
{
Get {
Things {
Author (where:{
operator:Equal,
path:["WroteArticles"]
valueString:" "
}){
name
WroteArticles {
... on Article {
InPublication {
... on Publication {
name
}
}
}
}
}
}
}
}
您现在可以按如下方式执行此操作(也在 documentation 中):
{
Get {
Things {
Author(
where:{
valueInt: 2
operator:GreaterThanEqual
path: ["WroteArticles"]
}
) {
name
WroteArticles {
... on Article {
title
}
}
}
}
}
}
如果我们有一个没有文章信标的作者,因此 WroteArticles 为空,我们只想 return 有 non-empty/non-null 的作者 WroteArticles,这怎么可能?
作为示例,我们可以使用 Weaviate demo site
我尝试过使用 where 和各种 运算符 进行过滤操作,但我一定遗漏了一些明显的东西。下面是我在自己的数据集上尝试过的查询示例,其中我确实有一个没有信标的 Thing。
{
Get {
Things {
Author (where:{
operator:Equal,
path:["WroteArticles"]
valueString:" "
}){
name
WroteArticles {
... on Article {
InPublication {
... on Publication {
name
}
}
}
}
}
}
}
}
您现在可以按如下方式执行此操作(也在 documentation 中):
{
Get {
Things {
Author(
where:{
valueInt: 2
operator:GreaterThanEqual
path: ["WroteArticles"]
}
) {
name
WroteArticles {
... on Article {
title
}
}
}
}
}
}