private function formatQueryElementRel($key, $value, EntityMetadata $metadata, Store $store)
    {
        if (null === $relMeta = $metadata->getRelationship($key)) {
            return;
        }

        $converter = $this->getQueryRelConverter($store, $relMeta);

        if (true === $relMeta->isPolymorphic()) {
            $key = sprintf('%s.%s', $key, Persister::IDENTIFIER_KEY);
        }

        if (is_array($value)) {
            $value = (true === $this->hasOperators($value)) ? $value : ['$in' => $value];
            return [$key, $this->formatQueryExpression($value, $converter)];
        }
        return [$key, $converter($value)];
    }