I am using ArangoDB and I am requesting a collection with a name movies. Its data structure is such that it categoriesis a list of strings.
public class movies
{
[DocumentProperty(Identifier = IdentifierType.Key)]
public string Key;
public List<string> categories;
public string desc;
public string img;
public List<vod_stream> streams;
public string title;
};
Here is the request:
var result = db.Query<movies>()
.Where(p => p.categories.Contains(id));
idpassed as a parameter, and I need to get all movies that have a category corresponding to id. However, the code above does not work, as it resultgives me ALL the movies in the collection.
foreach (movies mov in result)
{
if (mov.categories.Contains(id) == false)
{ continue; }
}
It is strange when I look at elements as a result, the same function returns falsefor some elements. But that just doesn't work in the Linq statement.
Does anyone know what is wrong with my query operation?
source
share