C# to F# Neo4j.Driver

Hi All

Please could someone help with the correct syntax for using the Neo4j.Driver for DotNet in F#.

In C# I have this approach working well:

var _driver = GraphDatabase.Driver("bolt://:"
, AuthTokens.Basic("", "<password")
, builder => builder.WithEncryptionLevel(EncryptionLevel.Encrypted));

var session = _driver.AsyncSession();

In F# I am battling to do the 'builder' part

let _driver = GraphDatabase.Driver (":"
, AutTokens.Basic("", ""
, ?????)

Help greatly appreciated.

Darryl

Hi!

Have you tried with the following?

let _driver = GraphDatabase.Driver ("neo4j://localhost:7687", AuthTokens.Basic("neo4j", "neo"), fun b ->b.WithEncryptionLevel(EncryptionLevel.None) |> ignore)

The |> ignore is necessary because the builder methods return an instance of the builder object, so there is a mismatch of the signature expected by the Driver method and the one you might be passing.