Check the type of a property in neomodel

204 views Asked by At

Is it possible to get the type of a property in neomodel? For example something like this:

for n in MyNodeModel.properties: 
    if n == StructuredNode:
        print('StructuredNode')

I hope my questions is clear...

1

There are 1 answers

0
rob On BEST ANSWER

Sure you just need to get the property object from the model:

if isinstance(MyNodeModel.your_property, StringProperty):
    print("a string")

If this doesn't answer your question please open an issue on github