cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

C# to F# Neo4j.Driver

darryl
Node Link

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

1 REPLY 1

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.