Check the type of a property in neomodel

224 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 best solutions below

0
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