Primary Key and IDs in RedisGraph

Can we have the concept of the primary key in RedisGraph and set some properties as Key? Something like current entity ids, but can be controlled by the user.

Another question is, is it possible to filter entities by their id, without using the WHERE clause, such that:
GRAPH.QUERY TestGraph "Match (a: A {ID(a): 3}) RETURN"

The above query doesn’t work and I should use the WHERE clause to make it work:
GRAPH.QUERY TestGraph "Match (a: A) WHERE ID(a) = 3 RETURN"

Sorry but I’m not sure I fully understand your first question about the primary key,
I’ll mention that RedisGraph has an index you can create over labels and properties, see doc

With regard to filtering, inline filtering such ( {ID(a): 3} ) isn’t support by the language, inline filters should take the form of: {property: value} where the criteria requires the property to have specified attribute,
for more complex filters please use the WHERE clause.

1 Like

Hi SWilly22,
Thanks for your answer

By primary key I mean the ability to declare a property as key, so the Redis guarantees that the property remains unique for each entity type. So when I filter the Match query using the key property, I will get at most one entity in return. Exactly like the current entity IDs but at the property level.

I see, these are schema capabilities which we’ve yet to support.