Created
          May 1, 2013 23:47 
        
      - 
      
 - 
        
Save tareqabedrabbo/5499253 to your computer and use it in GitHub Desktop.  
    Neo4j Labels and Schema Indexes
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | match p:Person, l:Location | |
| where p.first_name! = {first_name} and l.location = {location} | |
| create p-[:LIVES_IN]->l | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | curl http://localhost:7474/db/data/cypher?profile=true -X POST -H "Accept: application/json" -H "Content-type: application/json" -d '{"query" : "match p:Person where p.first_name! = \"George\" return p.first_name, p.last_name"}' | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | create index on :Person(first_name) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | create index on :Person(last_name) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | create (n:Person {first_name : "Peppa", last_name : "Pig"}) | |
| create (n:Person {first_name : "George", last_name : "Pig"}) | |
| create (n:Person {first_name : "Mummy", last_name : "Pig"}) | |
| create (n:Person {first_name : "Daddy", last_name : "Pig"}) | |
| create (n:Location {location : "The Pigs house"}) | |
| create (n:Person {name : "Bob the bat"}) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | match p:Person | |
| where p.first_name = "George" | |
| return p.first_name, p.last_name | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | match p:Person | |
| where p.first_name! = "George" | |
| return p.first_name, p.last_name | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | match p:Person | |
| where p.last_name = "Pig" and p.first_name = "Peppa" | |
| return p.first_name | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | match p:Person | |
| using index p:Person(first_name) | |
| where p.last_name = "Pig" and p.first_name = "Peppa" | |
| return p.first_name | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment