I am trying to create a node and also assign a label to that node. Following the instructions in Using Neo4j Graph DB With F#, I managed to create the Person nodes, but I could not create a label Person for the node created. Is my use of the create method wrong? Do I need to pass it as a parameter? Could I use the Cypher create instead of create?
Asked
Active
Viewed 774 times
4
-
1How do you expect us to know if your use of the method is wrong without posting exactly what you tried? – John Palmer Nov 26 '13 at 04:55
1 Answers
8
The example uses the old API based way of using 'Create' so you used to do:
client.Create person
now you can (and should) use the Cypher version:
let createPerson person =
client.Cypher
.Create("(p:Person {param})")
.WithParam("param", person)
.Return<Person>("p")
.Results
.Single();
let pA = createPerson { Name = "PersonA"; Twitter = "tA" }
And you should be passing in the person as a parameter. Using the Cypher version is the only way to get labels into your db.

Charlotte Skardon
- 6,220
- 2
- 31
- 42
-
2If you are interested - I have updated all of Sergey's post here: http://geekswithblogs.net/cskardon/archive/2013/11/27/using-neo4j-with-f-ndash-cypher-2.0.aspx – Charlotte Skardon Nov 27 '13 at 10:34