How to use the redisgraph.query_result.QueryResult function in redisgraph

To help you get started, we’ve selected a few redisgraph examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RedisGraph / redisgraph-py / redisgraph / client.py View on Github external
def query(self, q):
        """
        Executes a query against the graph.
        """
        statistics = None
        result_set = None
        response = self.redis_con.execute_command("GRAPH.QUERY", self.name, q)

        result_set = response[0]
        statistics = response[1]

        return QueryResult(result_set, statistics)
github RedisGraph / redisgraph-py / redisgraph / graph.py View on Github external
def query(self, q, params=None):
        """
        Executes a query against the graph.
        """
        if params is not None:
            q = self.build_params_header(params) + q

        statistics = None
        result_set = None

        response = self.redis_con.execute_command("GRAPH.QUERY", self.name, q, "--compact")
        return QueryResult(self, response)