-- | Like nestEq, but for an embedded list.
-- Checks to see if the nested list contains an item.
nestAnyEq :: forall record typ.
        ( PersistField typ
        , PersistEntityBackend record ~ DB.MongoContext
        ) => NestedField record [typ] -> typ -> Filter record
fld `nestAnyEq` val = BackendFilter $
    NestedArrayFilter fld $ PersistFilterOperator (Left val) Eq
nestAnyEq :: forall record typ.
        ( PersistField typ
        , PersistEntityBackend record ~ DB.MongoContext
        ) => NestedField record [typ] -> typ -> Filter record
fld `nestAnyEq` val = BackendFilter $
    NestedArrayFilter fld $ PersistFilterOperator (Left val) Eq
fld `nestAnyEq` val = BackendFilter $
    NestedArrayFilter fld $ PersistFilterOperator (Left val) Eq