graphgen icon indicating copy to clipboard operation
graphgen copied to clipboard

Unable to pass '$count' parameter to `randomElements` provider

Open dlobue opened this issue 8 years ago • 1 comments

The pattern (p:Power { level: {randomElements:[[-1,2,3], 4]}}) produces a Power node where the value of the level property is an array containing 1 item. It produces one of two nodes:

(:Power {level: [4]})

Or:

(:Power {level: [[-1,2,3]]})

I would expect it to create a node like the following:

(:Power {level: [-1,2,-1,3]})

The randomElement provider functions the same way. The example provided by the docs ({ level: {randomElement:[[-1,2,3]] }}), results in a property with the value of [-1,2,3]. In order to get a result like the documentation says you should get, you have to flatten that array.

dlobue avatar Dec 01 '17 17:12 dlobue

Thanks for the report, it is indeed a bug.

ikwattro avatar Dec 01 '17 18:12 ikwattro