Preview

graphGist asciiDoc file for use at http://gist.neo4j.org/ [GitHub Gist]

Generated on Sun Jul 28 08:03:44 PDT 2013

Running queries, preparing the console!

query to create one node with one property

      CREATE (n {name : 'Immanuel'})
Loading table...

query to add property to node

      START n=node(*)
      WHERE n.name! = 'Immanuel'
      SET n.lastName = 'Kant'
      RETURN n as kant
Loading table...

query to add and remove property from node

      START n=node(*)
      WHERE n.name! = 'Immanuel'
      SET n.firstName = 'Immanuel'
      REMOVE n.name
      RETURN n as kant
Loading table...

query to filter with AND HAS and RegEx

      START n=node(*)
      WHERE
        HAS(n.firstName)           // test existence
        AND n.firstName! = 'Immanuel'  // test not Null and equal
        AND n.lastName =~ '^K.*'   // RegEx
        AND n.firstName =~ '(?i)immANuEl'      // case insensitive RegEx
        AND n.lastName IN [ 'Kant', 'Kan', 'NoIKant', 'YesIKan' ]  // in list
      RETURN n as kant
Loading table...

query to delete node

      START n=node(*)
      WHERE n.firstName! = 'Immanuel'
      DELETE n
Loading table...