Skip to content

Return redisgraph data without mapping it to objects #2403

Open
@jonaskello

Description

@jonaskello

Motivation

Redisgraph data is first returned as an array of arrays. But inside the graph module it is then remapped to objects:

https://github.com/redis/node-redis/blob/master/packages/graph/lib/graph.ts#L233

I think it would be nice if the caller can decide if the cost of mapping to objects is needed. Basically I would prefer if the original format for GraphReply with just arrays was returned and then I could do any mapping outside if needed.

Basic Code Example

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

// result will always be an array of objects, would prefer the original redis reply format of array or arrays to be retained

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions