CYPHER has the indexing operator [].
Simple examples of its use are WITH {a:'Hello World!'} AS map RETURN map['a'] and WITH ['Hello World!'] AS list RETURN list[0].
More complicated examples are WITH 2 AS a, ['a','b','Hello World!'] AS list RETURN list[a], WITH {a:'Hello World!',c:'a'} AS map RETURN map[map['c']] and
WITH ['a','Hello World!','b'] AS list, {ab:1} AS map RETURN list[map[list[0]+list[2]]]
All of these should return Hello World!
I think [] should be implemented on things of CompositeType and CompositeTypeTrait should have this implemented like ->index($index) where $index is either a string-like thing or integer-like thing. (In particular, lists only accept integers and maps only accept strings if I'm correct).
CYPHER has the indexing operator
[].Simple examples of its use are
WITH {a:'Hello World!'} AS map RETURN map['a']andWITH ['Hello World!'] AS list RETURN list[0].More complicated examples are
WITH 2 AS a, ['a','b','Hello World!'] AS list RETURN list[a],WITH {a:'Hello World!',c:'a'} AS map RETURN map[map['c']]andWITH ['a','Hello World!','b'] AS list, {ab:1} AS map RETURN list[map[list[0]+list[2]]]All of these should return
Hello World!I think
[]should be implemented on things ofCompositeTypeandCompositeTypeTraitshould have this implemented like->index($index)where$indexis either a string-like thing or integer-like thing. (In particular, lists only accept integers and maps only accept strings if I'm correct).