Hi,
I have problems in building an expression based on array of objects. Didn’t found a way to access
A filter(Couchbase expression) is set to query for documents:
Query.Select(…).Where(expression)
and the structure of a document looks like this:
company{
id
_typename
name
companytype
owner
detail{
mobile
fax
}
subsidiary{
[ {
city
streetname
} ]
}
}
If I want to have all the companies with the companytype = 2, the expression will be Expression.Property(“companytype”).EqualTo(2).
But how can I take all the companies for which subsidiary.city = Berlin (= at least one object from the array has the city = Berlin).
What I found on the documentation is how to set an expression on a simple array, for example array of strings:
Expression.Any(“x”).In(Expression.Property(“phones”)).Satisfies(Expression.Variable(“x”).EqualTo(3));
But how can I do it for an array of objects, by accesing one or more properties of each object of the array (city, streetname)?
Thanks
Ramona