Guest User

Untitled

a guest
Jan 16th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. clientName = clientNameField.text
  2.  
  3.  
  4. guard let theo = self.theo else {
  5. log("Client not initialized yet")
  6. return
  7. }
  8.  
  9. let result = theo.executeCypherSync("MATCH (c:Client) WHERE c.name = (clientName) RETURN c.name as name, c.dob as dateOfBirth")
  10. switch result {
  11. case let .failure(error):
  12. log("Error while getting cypher results: (error)")
  13. case let .success(queryResult):
  14. if let arrayClients = queryResult.rows[21]["name"] as? String {
  15. log("Asked via Cypher how many nodes there are with label 'name'. Answer: (arrayClients)")
  16.  
  17. query.append(arrayClients)
  18. print(query)
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25. } else {
  26. log("Got unexpected answer back")
Add Comment
Please, Sign In to add comment