OrientDB:包含所有操作符
OrientDB: containsall operator
我收集了一些文件。文档有一个字段,其值是一组地图(例如:具有一个字段 name
的地图)。结构是这样的:
{
arrayfield: [
{
name: "value1",
},
{
name: "value2",
}
]
}
我想获取 arrayfieds
所有映射都包含指定数组值的文档。文档说我可以使用 containsall
运算符。我是这样使用的:
select from SomeCollection where arrayfiled containsall (name in ['value1','value2'])
但是这个构造总是returns空结果。我哪里做错了?谢谢。
PS:如果我的问题不明白,我可以post收集更详细的示例和我想要收到的结果。
尝试以下查询
select from SomeCollection where arrayfiled.name contains "value1" and arrayfiled.name contains "value2"
找到了解决我的问题而不包含 containsAll 的方法:
select from SomeCollection where not (arrayfield contains (fname not in ["value1", "value2"]))
我收集了一些文件。文档有一个字段,其值是一组地图(例如:具有一个字段 name
的地图)。结构是这样的:
{
arrayfield: [
{
name: "value1",
},
{
name: "value2",
}
]
}
我想获取 arrayfieds
所有映射都包含指定数组值的文档。文档说我可以使用 containsall
运算符。我是这样使用的:
select from SomeCollection where arrayfiled containsall (name in ['value1','value2'])
但是这个构造总是returns空结果。我哪里做错了?谢谢。
PS:如果我的问题不明白,我可以post收集更详细的示例和我想要收到的结果。
尝试以下查询
select from SomeCollection where arrayfiled.name contains "value1" and arrayfiled.name contains "value2"
找到了解决我的问题而不包含 containsAll 的方法:
select from SomeCollection where not (arrayfield contains (fname not in ["value1", "value2"]))