I am using the Neomodel Python package with the Neo4j database and loving it. I am currently using the filter() method, but every time I use the filter() method on a property not defined in the SemiStructuredNode I get an error.
In the example below I have my Person SemiStructuredNode with only surname as a property, but some nodes in the database might have eye_colour as well and I want to filter by that. Note that not all nodes will have eye colour.
class Person(SemiStructuredNode):
surname = StringProperty()
Person.nodes.filter(surname__contains='atts',eye_colour='BLUE')
To me the code above should work but I get a ValueError: No such property eye_colour on Person
error. However, if I change my class definition to include eye_colour as a StringProperty everything is fine. However, I do not want to do this because there are various other dynamic filters I want to use because of different data being imported into the system.
Does Neomodel support what I'm trying to do or will I have to build a Cypher query or can someone see what I'm getting wrong?