droiddude
droiddude

Reputation: 187

NEO4J: Is it possible to use regular expressions in Relationshiptypes with Cypher?

is it possible to use regex in relationshiptypes. In some cases my application generates dynamically RelTyps. So when it comes to execute a cyhper query, the application only knows a specific part of the relationshiptyp. Because of this I want to use a regex for the rest of the relationship. Here is an example for a possible dynamic relationshiptyp:

(node)-[:`http://www.examplerelation.com/type/number/test[1]`]->(otherNode)

I want to replace the number in "text[]" with a regular expression. The other question is, would it be better to save this number as a property in the relationship?

Thanks for your help! Greetings Max :)

Upvotes: 0

Views: 489

Answers (1)

MrDosu
MrDosu

Reputation: 3435

You should not misuse the relationship type to store data. This can also lead to serious performance problems. Store the data in a property of the relationship.

You will also run into issues with the 32k relationship type limit (link).

Upvotes: 3

Related Questions