1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00
Files
node-redis/packages/graph
2022-10-26 14:47:10 -04:00
..
2022-01-31 12:52:19 -05:00
2022-01-31 12:52:19 -05:00
2022-10-26 14:47:10 -04:00
2022-10-25 07:20:55 -04:00
2022-01-31 12:52:19 -05:00

@redis/graph

Example usage:

import { createClient } from 'redis';

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

await client.connect();

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

const result = await client.graph.query(
  'graph',
  `MATCH (r:Rider)-[:rides]->(t:Team) WHERE t.name = 'Apollo' RETURN r.name, t.name`
);

console.log(result);

Output from console log:

{
  headers: [ 'r.name', 't.name' ],
  data: [ [ 'Buzz Aldrin', 'Apollo' ] ],
  metadata: [
    'Cached execution: 0',
    'Query internal execution time: 0.431700 milliseconds'
  ]
}