Return overload fails

后端 未结 4 1332
独厮守ぢ
独厮守ぢ 2021-01-20 01:34

I\'m following this little write up: https://github.com/Readify/Neo4jClient/wiki/cypher but I\'m doing it from Powershell. so what I have so far is

[System.         


        
4条回答
  •  礼貌的吻别
    2021-01-20 02:15

    The best I can tell is that you're using it wrong. Your object structure should be your Neo4jClient object, which should then have a few properties and methods. I am pretty sure that Return is a property, not a method. So I'm thinking something more like:

    $neo = new-object Neo4jClient.GraphClient(new-object Uri("http://localhost:7474/db/data"))
    $neo.Cypher.Match = "n"
    $neo.Cypher.Return = {param($m) $m}
    $q = $neo.Cypher.Results()
    

    There you create your object, you define the Match filter, define what you want it to return (everything from the looks of it), and then store the results in the $q variable. I'm pretty sure that should be the same as:

    SELECT * FROM Uri("http://localhost:7474/db/data")) WHERE "n"
    

    I also kind of wonder about your Match criteria, since they seem to be specifying property/value pairs in their examples and you just give one of the two. If that fails I would strongly suggest doing a $neo.Cypher | Get-Member to see what properties you have, what they're typed as, and what methods you have.

    Edit: Ok, so I did look at the link. I also downloaded the libraries, loaded them into PowerShell, and looked at the .Net objects. Return is indeed a method, and the overloads for it are ridiculous. There are 37 overloads for it, the longest of which is almost 750 characters. Most of them are ICypherResultItem expressions, but the simplest is (string identity). Might I suggest simply trying Return("*")?

提交回复
热议问题