cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

How to use match function in python when the targeted matching 'property' is a list?

I create a node, the node name is robot, the robots has a property, which is called 'capabilities'. For the capabilities, there is a list of all the capabilities for the robot. For example, the robot in the picture below has a capability lists, [Moving,ForceApplying].
3X_2_5_258718823d986e42b1f0f57025d998ea3ab2be5d.png

Now I want to use matcher.match command in Py2neo to search for the robot node with specific capability. If the capability I am searching for is Moving. Then how do I write the code? Below is the code I write, but doesn't work,

a = matcher.match('Robot', capabilities = 'Moving').first()

3X_2_7_27320f1c12d50f1b9dab16b083eb9b9ea3c70e99.png

1 REPLY 1

I think that's not expressible (yet) with py2neo matchers, it seems that list properties are not yet supported for ` WHERE $value in node.capabilities` 

https://py2neo.org/v4/matching.html#node-matching

In your model it might also make more sense to pull out those capabilities as extra nodes and link the robot to them.