Skip to content

Please restore default values to call to get a node's property #172

Closed
@crichey

Description

@crichey

With Neo3 and bolt the method for getting a property value from a node lost the ability to set a default value in case the property doesn’t exist in the node. That was a VERY useful feature. With the current implementation you end up taking code that effectively was (prior to Bolt) as simple and clear as:
String myValue = node.get(“myValue”,””)
to

String myValue = “"
if(node.containsKey(“myValue”)) { myValue = node.get(“myValue”).asString()}

Obviously its not a huge deal if you have to do it once, but when you have to do it frequently (as I am when migrating 2.3 code to bolt) then it is a bit of a pain and a source of potential errors.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions