def METHOD_NAME(request_parameters: ImmutableMultiDict) -> dict:
    """
    Parse the query parameter from request parameters. Query is a dictionary representing a MongoDB query.
    :param request_parameters: dict containing the request parameters.
    :return: The MongoDB query as dict.
    """
    try:
        query = request_parameters.get('query')
        query = json.loads(query if query else '{}')
    except (AttributeError, KeyError):
        return {}
    except json.JSONDecodeError:
        raise ValueError('Query must be a json document')  # noqa: B904
    if not isinstance(query, dict):
        raise ValueError('Query must be a json document')
    return query if query else {}