1
0
mirror of https://github.com/redis/node-redis.git synced 2025-07-31 05:44:24 +03:00
Files
2024-02-05 11:18:27 -05:00
..
2022-12-26 13:35:37 -05:00
2024-02-05 11:18:27 -05:00
2022-11-01 15:54:29 -04:00
2022-01-31 12:52:19 -05:00

@redis/graph

Example usage:

import { createClient, Graph } from 'redis';

const client = createClient();
client.on('error', (err) => console.log('Redis Client Error', err));

await client.connect();

const graph = new Graph(client, 'graph');

await graph.query(
  'CREATE (:Rider { name: $riderName })-[:rides]->(:Team { name: $teamName })',
  {
    params: {
      riderName: 'Buzz Aldrin',
      teamName: 'Apollo'
    }
  }
);

const result = await graph.roQuery(
  'MATCH (r:Rider)-[:rides]->(t:Team { name: $name }) RETURN r.name AS name',
  {
    params: {
      name: 'Apollo'
    }
  }
);

console.log(result.data); // [{ name: 'Buzz Aldrin' }]