2

I try to query count related nodes of a specific one with Neo4jClient in F#. But keep receiving the following error:

System.MissingMethodException: Method not found: 'System.Type Newtonsoft.Json.JsonContainerAttribute.get_NamingStrategyType()'.

I just cannot find the answer in documentation of the packages. Filtering with the lambda function works in the "select" stage but not in "where".

[<CLIMutable>]
type User = { id : int; followers : int }

let tweetsCounted = 
  client.Cypher
    .Match("(u:User)-[:POSTED]->(t:Tweet)")
    .Where(fun u -> u.followers = 1000)
    .Return(fun (u : Cypher.ICypherResultItem) (t : Cypher.ICypherResultItem) -> u.As<User>(), t.Count())
    .Results
    .Select(fun (x, y) -> x.id, y)
AnotherNewbie
  • 198
  • 1
  • 1
  • 6
  • I'm not sure where the problem lies - are you saying that the code above errors? If so - what makes it not error? By the `where` stage - do you mean the `.Where` on the client or another way? – Charlotte Skardon Apr 11 '18 at 08:23
  • 2
    I've just added some F# tests to the client (https://github.com/Readify/Neo4jClient/pull/270) the `.Where` is working as expected, as is the `.Return` - maybe you could give me a failing test so I can look into more? – Charlotte Skardon Apr 11 '18 at 10:33
  • Thank you, first passing a parameter like solved the issue while lambda function way produced the mentioned error. `` .Where("u.followers = {followers}") .WithParams( {followers = filterUser.followers} ) `` I reset my connection, restarted FSI and cannot reproduce the issue. I can confirm that the script above runs as expected. – AnotherNewbie Apr 18 '18 at 04:31

1 Answers1

0

Just so this question has an answer.

I've added unit tests to test the functionality of F# with respect to WHERE and RETURN clauses, and they pass as expected (see http://github.com/Readify/Neo4jClient/pull/270).

The error as mentioned by @AnotherNewbie is not reproducible in their environment anymore either.

Charlotte Skardon
  • 6,220
  • 2
  • 31
  • 42