MongoEngine - Query Operator for "contains" - Check if value is in list

1.5k Views Asked by At

I have a MongoDB ListField() of IDs and need to check in a query if a certain ID is in this list.

Usually I do it the other way round: I check if a value is in a list.

MyClass.objects.filter(id__in=id_list)

I tried to use the "contains" query operator but it seems to work only for strings.

So, does anybody know how to achieve this?

Thanks :)

0

There are 0 best solutions below