RedisGraph / redisgraph.js

A Javascript client for RedisGraph
https://redisgraph.io
BSD 3-Clause "New" or "Revised" License
100 stars 26 forks source link

RedisGraph Map Projections #80

Open alexstaroselsky opened 3 years ago

alexstaroselsky commented 3 years ago

When dealing with map projections, what would be the proper way to extract the keys/values from the iterator? Given query:

MATCH (n) RETURN n {.name, .age} AS projection

What would be the proper path for extracting the object(s) containing name and age projections? Logging out the value of res.next() for that query outputs the following in the console:

Record {
  _header: [ 'n {.name, .age}' ],
  _values: [ { name: 'foo', age: 42 } ]
}

How would you get the value(s), being an array of objects equal to [ { name: 'foo', age: 42 } ]?