1

I'm using Redisgraph. I'm using this query:

MERGE (p:Person { age: 0 } )
RETURN p

But what I get is age: "".

If I query:

MERGE (p:Person { age: 12 } )
RETURN p

This correctly store age: 12 (without quotes).

How can I store the numeric value of 0? Thank you!

1 Answers1

2

A minimal example which create a node with an attribute with the value 0 and retrieves it using redisgraph.js

const RedisGraph = require("redisgraph.js").Graph;
let graph = new RedisGraph("G");

(async () =>{
        await graph.query("CREATE (:L {v:0})");
        let res = await graph.query("MATCH (a) RETURN a, a.v");
        while (res.hasNext()) {
            let record = res.next();
            console.log(record.get("a"));
            console.log(record.get("a.v"));
        }

        graph.deleteGraph();
        graph.close();
    
    })();

Output:

Node { id: 1, label: undefined, properties: { v: 0 } }
0 

@albertoSpinella would you mind sharing a reproducible snippet?

SWilly22
  • 869
  • 4
  • 5
  • Thank you @SWilly22. If I run redisInsight, go to RedisGraph section and run `CREATE (:L {v:0})`, then my node is the following: `id: 0, v: ""`. – albertoSpinella Feb 10 '22 at 21:44