2

In using the Neo4J browser UI, I encountered this strange behavior when trying to pass a list of strings as a parameter. (I was doing this so that I could query for nodes having a property value in the list.)

$ :param names: ["bob", "alice"]
$ RETURN $names = ["bob", "alice"]

This returns true, as expected.

$ :param nums: ["5", "22"]
$ RETURN $nums = ["5", "22"]

This returns false.

$ :param nums: ["5", "22"]
$ RETURN extract(x IN $nums | toString(x)) = ["5", "22"]

This returns true.

I don't understand why putting numbers in the strings requires the extra string conversion. Maybe it's a bug in how parameters are stored. Or am I just missing something?

user19650
  • 153
  • 9
  • What version of Neo4j are you using? Here `RETURN $nums = ["5", "22"]` returns true... I'm using Neo4j 3.2.1 CE. – Bruno Peres Jul 07 '17 at 16:58
  • I am using 3.1.1 CE of Neo4J. The browser UI reports version 2.0.0. – user19650 Jul 07 '17 at 17:59
  • Every one of these is returning true for me in 3.2.1. Can you check each of those examples and make sure those are correct? I have a feeling you meant to use numbers rather than strings in the `$nums` param in the second example. – InverseFalcon Jul 07 '17 at 20:50
  • I'm 100% sure. I've just confirmed it again. Check this out: [screenshot](http://i.imgur.com/aNhOWdq.jpg) – user19650 Jul 07 '17 at 23:18
  • I can confirm that working with either :param nums: [5, 22] or :param nums: ["5", "22"] returns true in version 3.2.2 CE. Must be a bug in 3.1.1. – Tom Geudens Jul 08 '17 at 15:11

0 Answers0