{"id":21228461,"url":"https://github.com/bitfede/cypher-cheat-sheet","last_synced_at":"2026-03-19T19:23:55.820Z","repository":{"id":54289205,"uuid":"192268503","full_name":"bitfede/cypher-cheat-sheet","owner":"bitfede","description":"A simple cheat sheet for the cypher query language","archived":false,"fork":false,"pushed_at":"2019-06-28T15:06:55.000Z","size":7,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-05T13:01:51.091Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitfede.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-17T03:25:02.000Z","updated_at":"2024-08-12T12:59:34.000Z","dependencies_parsed_at":"2022-08-13T11:01:11.772Z","dependency_job_id":null,"html_url":"https://github.com/bitfede/cypher-cheat-sheet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bitfede/cypher-cheat-sheet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfede%2Fcypher-cheat-sheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfede%2Fcypher-cheat-sheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfede%2Fcypher-cheat-sheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfede%2Fcypher-cheat-sheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitfede","download_url":"https://codeload.github.com/bitfede/cypher-cheat-sheet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfede%2Fcypher-cheat-sheet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29447193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T14:10:32.461Z","status":"ssl_error","status_checked_at":"2026-02-14T14:09:49.945Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T23:19:07.356Z","updated_at":"2026-02-14T14:31:19.704Z","avatar_url":"https://github.com/bitfede.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cypher Cheatsheet\n\n## Reading Data (Basic Queries)\n\n### Examining the Data Model\n\n```\nCALL db.schema\n```\n\n### Specifying a Node\n\n```\n()\n(variable)\n(:Label)\n(variable:Label)\n(:Label1:Label2)\n(variable:Label1:Label2)\n```\n\n### Retrieve a Node\n\n```\nMATCH (variable)\nRETURN variable\n```\n```\nMATCH (variable:Label)\nRETURN variable\n```\n\n### Retrieving Nodes Filtered by a Property Value\n\n```\nMATCH (variable {propertyKey: propertyValue})\nRETURN variable\n```\n```\nMATCH (variable:Label {propertyKey: propertyValue})\nRETURN variable\n```\n```\nMATCH (variable {propertyKey1: propertyValue1, propertyKey2: propertyValue2})\nRETURN variable\n```\n```\nMATCH (variable:Label {propertyKey: propertyValue, propertyKey2: propertyValue2})\nRETURN variable\n```\n\n### Returning Property Values\n\n```\nMATCH (variable {prop1: value})\nRETURN variable.prop2\n```\n```\nMATCH (variable:Label {prop1: value})\nRETURN variable.prop2\n```\n```\nMATCH (variable:Label {prop1: value, prop2: value})\nRETURN variable.prop3\n```\n```\nMATCH (variable {prop1:value})\nRETURN variable.prop2, variable.prop3\n```\n\n### Specifying Aliases\n\nTo customize the header titles of the data table.\n\n```\nMATCH (variable:Label {propertyKey1: propertyValue1})\nRETURN variable.propertyKey2 AS alias2\n```\n\n### Querying using relationships\n\n```\nMATCH (node1)-[:REL_TYPE]-\u003e(node2)\nRETURN node1, node2\n```\n```\nMATCH (node1)-[:REL_TYPEA \\| :REL_TYPEB]-\u003e(node2)\nRETURN node1, node2\n```\n## Reading Data (Advanced Queries)\n\n### Filtering queries using WHERE\n\nSpecify an or condition\n```\nMATCH (p:Person)-[:ACTED_IN]-\u003e(m:Movie)\nWHERE m.released = 2008 OR m.released = 2009\nRETURN p, m\n```\nSpecify a range\n```\nMATCH (p:Person)-[:ACTED_IN]-\u003e(m:Movie)\nWHERE m.released \u003e= 2003 AND m.released \u003c= 2004\nRETURN p.name, m.title, m.released\n```\nFilter by specific property value\n```\nMATCH (p)-[:ACTED_IN]-\u003e(m)\nWHERE p:Person AND m:Movie AND m.title='The Matrix'\nRETURN p.name\n```\nTest existence of a property\n```\nMATCH (p:Person)-[:ACTED_IN]-\u003e(m:Movie)\nWHERE p.name='Jack Nicholson' AND exists(m.tagline)\nRETURN m.title, m.tagline\n```\nTest strings' properties\n```\nMATCH (p:Person)-[:ACTED_IN]-\u003e()\nWHERE p.name STARTS WITH 'Michael'\nRETURN p.name\n```\nUse RegEx\n```\nMATCH (p:Person)\nWHERE p.name =~'Tom.*'\nRETURN p.name\n```\nTest list values\n```\nMATCH (p:Person)\nWHERE p.born IN [1965, 1970]\nRETURN p.name as name, p.born as yearBorn\n```\n\n### Setting path variables\n```\nMATCH megPath = (meg:Person)-[:ACTED_IN]-\u003e(m:Movie)\u003c-[:DIRECTED]-(d:Person),(other:Person)-[:ACTED_IN]-\u003e(m)\nWHERE meg.name = 'Meg Ryan'\nRETURN megPath\n```\n\n### Specifying varying length paths\n```\nMATCH (follower:Person)-[:FOLLOWS*2]-\u003e(p:Person)\nWHERE follower.name = 'Paul Blythe'\nRETURN p\n```\nRetrieve all paths of any length with the relationship, :RELTYPE from nodeA to nodeB and beyond:\n```\n(nodeA)-[:RELTYPE*]-\u003e(nodeB)\n```\n\n### Finding the Shortest Path\n\n```\nMATCH p = shortestPath((m1:Movie)-[*]-(m2:Movie))\nWHERE m1.title = 'A Few Good Men' AND\n      m2.title = 'The Matrix'\nRETURN  p\n```\n\n### Optional Pattern Matching\n```\nMATCH (p:Person)\nWHERE p.name STARTS WITH 'James'\nOPTIONAL MATCH (p)-[r:REVIEWED]-\u003e(m:Movie)\nRETURN p.name, type(r), m.title\n```\n\n### Aggregation\n```\nMATCH (a)-[:ACTED_IN]-\u003e(m)\u003c-[:DIRECTED]-(d)\nRETURN a.name, d.name, count(*)\n```\n\n### Aggregate results into a list\n```\nMATCH (p:Person)-[:ACTED_IN]-\u003e(m:Movie)\nWHERE p.name ='Tom Cruise'\nRETURN collect(m.title) AS `movies for Tom Cruise`\n```\n\n### Count data items\n```\nMATCH (actor:Person)-[:ACTED_IN]-\u003e(m:Movie)\u003c-[:DIRECTED]-(director:Person)\nRETURN actor.name, director.name, count(m) AS collaborations, collect(m.title) AS movies\n```\n\n### Additional processing using `WITH`\n```\nMATCH (a:Person)-[:ACTED_IN]-\u003e(m:Movie)\nWITH  a, count(a) AS numMovies, collect(m.title) as movies\nWHERE numMovies \u003e 1 AND numMovies \u003c 4\nRETURN a.name, numMovies, movies\n```\n```\nAnother examples:\nMATCH (p:Person)\nWITH p, size((p)-[:ACTED_IN]-\u003e(:Movie)) AS movies\nWHERE movies \u003e= 5\nOPTIONAL MATCH (p)-[:DIRECTED]-\u003e(m:Movie)\nRETURN p.name, m.title\n```\n\n### Eliminate Duplication in Data\nUsing `DISTINCT`\n```\nMATCH (p:Person)-[:DIRECTED | :ACTED_IN]-\u003e(m:Movie)\nWHERE p.name = 'Tom Hanks'\nRETURN m.released, collect(DISTINCT m.title) AS movies\n```\nUsing `WITH` and `DISTINCT`\n```\nMATCH (p:Person)-[:DIRECTED | :ACTED_IN]-\u003e(m:Movie)\nWHERE p.name = 'Tom Hanks'\nWITH DISTINCT m\nRETURN m.released, m.title\n```\n\n### Ordering results\n```\nMATCH (p:Person)-[:DIRECTED | :ACTED_IN]-\u003e(m:Movie)\nWHERE p.name = 'Tom Hanks'\nRETURN m.released, collect(DISTINCT m.title) AS movies ORDER BY m.released DESC\n```\n\n### Limiting the number of results\n```\nMATCH (m:Movie)\nRETURN m.title as title, m.released as year ORDER BY m.released DESC LIMIT 10\n```\nUsing `WITH`\n```\nMATCH (a:Person)-[:ACTED_IN]-\u003e(m:Movie)\nWITH a, count(*) AS numMovies, collect(m.title) as movies\nWHERE numMovies = 5\nRETURN a.name, numMovies, movies\n```\n\n### Unwinding Lists\nCreating a list with three elements, unwinding it and then returning the values\n```\nWITH [1, 2, 3] AS list\nUNWIND list AS row\nRETURN list, row\n```\n\n### Dates\n```\nMATCH (actor:Person)-[:ACTED_IN]-\u003e(:Movie)\nWHERE exists(actor.born)\n// calculate the age\nwith DISTINCT actor, date().year  - actor.born as age\nRETURN actor.name, age as `age today` ORDER BY actor.born DESC\n```\n## Creating Nodes and Relationships\n\n### Creating nodes\n\n```\nCREATE (optionalVariable :optionalLabels {optionalProperties})\n```\nExample:\n```\nCREATE (m:Movie:Action {title: 'Batman Begins'})\nRETURN m.title //optionally you can return\n```\n\n### Creating multiple nodes\n\n```\nCREATE\n(:Person {name: 'Michael Caine', born: 1933}),\n(:Person {name: 'Liam Neeson', born: 1952}),\n(:Person {name: 'Katie Holmes', born: 1978}),\n(:Person {name: 'Benjamin Melniker', born: 1913})\n```\n\n### Adding labels to a node\n\n```\nSET nodeVariable:Label         // adding one label to node referenced by the variable x\n```\n```\nSET nodeVariable:Label1:Label2 // adding two labels to node referenced by the variable x\n```\nExample:\n```\nMATCH (m:Movie)\nWHERE m.title = 'Batman Begins'\nSET m:Action\nRETURN labels(m)\n```\n\n#### Removing labels from a node\n\n```\nREMOVE nodeVariable:Label    // remove the label from the node referenced by the variable x\n```\nExample:\n```\nMATCH (m:Movie:Action)\nWHERE m.title = 'Batman Begins'\nREMOVE m:Action\nRETURN labels(m)\n```\n\n### Adding properties to a node\n\n```\nSET nodeVariable.propertyName = value\n```\n```\nSET nodeVariable.propertyName1 = value1    , nodeVariable.propertyName2 = value2\n```\nWhen you assign the new property values to the Node using a `=`, you must make sure that the new properties object includes all of the properties and their values for the node as the existing properties for the node get overwritten. Example:\n```\nSET x = {propertyName1: value1, propertyName2: value2}\n```\nHowever, if you specify `+=` when assigning to a property, the value at valueX is updated if the propertyNnameX exists for the node. If the propertyNameX does not exist for the node, then the property is added to the node. Example:\n```\nSET x += {propertyName1: value1, propertyName2: value2}\n```\n\n### Removing properties from a node\n\n```\nREMOVE x.propertyName\n```\nor\n```\nSET x.propertyName = null\n```\n\n### Creating relationships\n\n```\nCREATE (x)-[:REL_TYPE]-\u003e(y)\n```\n```\nCREATE (x)\u003c-[:REL_TYPE]-(y)\n```\n\nExample 1:\n```\nMATCH (a:Person), (m:Movie)\nWHERE a.name = 'Michael Caine' AND m.title = 'Batman Begins'\nCREATE (a)-[:ACTED_IN]-\u003e(m)\nRETURN a, m\n```\nExample 2:\n```\nMATCH (a:Person), (m:Movie), (p:Person)\nWHERE a.name = 'Liam Neeson' AND\n      m.title = 'Batman Begins' AND\n      p.name = 'Benjamin Melniker'\nCREATE (a)-[:ACTED_IN]-\u003e(m)\u003c-[:PRODUCED]-(p)\nRETURN a, m, p\n```\n\n### Adding properties to relationships\n\n```\nSET r.propertyName = value\n```\n```\nSET r.propertyName1 = value1    , r.propertyName2 = value2\n```\n```\nSET r = {propertyName1: value1, propertyName2: value2}\n```\n```\nSET r += {propertyName1: value1, propertyName2: value2}\n```\n\nExample:\n```\nMATCH (a:Person), (m:Movie)\nWHERE a.name = 'Christian Bale' AND m.title = 'Batman Begins'\nCREATE (a)-[rel:ACTED_IN]-\u003e(m)\nSET rel.roles = ['Bruce Wayne','Batman']\nRETURN a, m\n```\nYou can even add properties to a relationship when the relationship is created:\n```\nMATCH (a:Person), (m:Movie)\nWHERE a.name = 'Christian Bale' AND m.title = 'Batman Begins'\nCREATE (a)-[:ACTED_IN {roles: ['Bruce Wayne', 'Batman']}]-\u003e(m)\nRETURN a, m\n```\nYou can test to see if the relationship exists before you create it as follows:\n\n```\nMATCH (a:Person),(m:Movie)\nWHERE a.name = 'Christian Bale' AND\n      m.title = 'Batman Begins' AND\n      NOT exists((a)-[:ACTED_IN]-\u003e(m))\nCREATE (a)-[rel:ACTED_IN]-\u003e(m)\nSET rel.roles = ['Bruce Wayne','Batman']\nRETURN a, rel, m\n```\n\n### Removing properties from a relationship\n\n```\nMATCH (a:Person)-[rel:ACTED_IN]-\u003e(m:Movie)\nWHERE a.name = 'Christian Bale' AND m.title = 'Batman Begins'\nREMOVE rel.roles\nRETURN a, rel, m\n```\n\n### Deleting relationships\n\n```\nMATCH (a:Person)-[rel:ACTED_IN]-\u003e(m:Movie)\nWHERE a.name = 'Christian Bale' AND m.title = 'Batman Begins'\nDELETE rel\nRETURN a, m\n```\n\n### Deleting nodes\n\nIf you want to delete a node, delete its relationships first using `DETACH`.\n\nNode without existing relationships:\n```\nMATCH (p:Person)\nWHERE p.name = 'Liam Neeson'\nDELETE p\n```\nNode with existing relationships:\n```\nMATCH (p:Person)\nWHERE p.name = 'Liam Neeson'\nDETACH DELETE  p\n```\n\n### Using `MERGE` to create nodes\n\n```\nMERGE (variable:Label{nodeProperties})\nRETURN variable\n```\nExample:\n```\nMERGE (a:Actor {name: 'Michael Caine'})\nSET a.born = 1933\nRETURN a\n```\n\n### Using `MERGE` to create relationships\n\n```\nMERGE (variable:Label {nodeProperties})-[:REL_TYPE]-\u003e(otherNode)\nRETURN variable\n```\nExample:\n```\nMATCH (p:Person), (m:Movie)\nWHERE m.title = 'Batman Begins' AND p.name ENDS WITH 'Caine'\nMERGE (p)-[:ACTED_IN]-\u003e(m)\nRETURN p, m\n```\n\n### Specifying creation behavior when merging\n\n`ON CREATE` will specify instructions to execute if no existing node is found during the `MERGE` call and needs to be created. Example:\n```\nMERGE (a:Person {name: 'Sir Michael Caine'})\nON CREATE SET a.birthPlace = 'London',\n              a.born = 1934\nRETURN a\n```\n\nYou can also specify an `ON MATCH` clause during merge processing. If the exact node is found, you can update its properties, change labels, or do some other logic. Example:\n```\nMERGE (a:Person {name: 'Sir Michael Caine'})\nON CREATE SET a.born = 1934,\n              a.birthPlace = 'UK'\nON MATCH SET a.birthPlace = 'UK'\nRETURN a\n```\n\n## More about Cypher\n\n### Cypher parameters\n\nParameters begin with the `$` symbol\n\n```\nMATCH (p:Person)-[:ACTED_IN]-\u003e(m:Movie)\nWHERE p.name = $actorName\nRETURN m.released, m.title ORDER BY m.released DESC\n```\nTo set them before calling the query:\n```\n:param actorName =\u003e 'Tom Hanks'\n```\n\n### Analyzing Cypher execution\n\nThere are two Cypher keywords you can use to prefix a Cypher statement with to analyze a query:\n\n- `EXPLAIN` gives an estimate of the graph engine processing that will occur if that statement is executed. Does NOT execute the Cypher statement.\n- `PROFILE` gives also data about the performance of the query but the Cypher statement gets executed.\n\n```\nEXPLAIN MATCH (p:Person)-[:ACTED_IN]-\u003e(m:Movie)\nWHERE p.name = $actorName AND\n      m.released \u003c  $year\nRETURN p.name, m.title, m.released\n```\n\n### Managing constraints and node keys\n\nCypher can also be used to:\n- **uniqueness constraint**. Makes sure a certain property is unique.\n- **existence constraint**. Makes sure a certain property exists (is not null).\n- **node key**. Ensures that a group of values of a node's properties is unique.\n\n#### Ensuring that a property value for a node is unique\n\nNode of type *Movie* must have each a unique *title*:\n```\nCREATE CONSTRAINT ON (m:Movie) ASSERT m.title IS UNIQUE\n```\n\n#### Ensuring that properties exist\n\nAll nodes of type *Movie* must have a *tagline* property:\n```\nCREATE CONSTRAINT ON (m:Movie) ASSERT exists(m.tagline)\n```\nAll relationships of type *REVIEWED* must have a *rating* property:\n```\nCREATE CONSTRAINT ON ()-[rel:REVIEWED]-() ASSERT exists(rel.rating)\n\n```\n\n#### Retrieving constraints defined for the graph\n\nGet back a list of all the constraints you defined:\n```\nCALL db.constraints()\n```\n\n#### Dropping constraints\n\nDelete a constraint you defined:\n```\nDROP CONSTRAINT ON ()-[rel:REVIEWED]-() ASSERT exists(rel.rating)\n```\n\n#### Creating Node Keys\n\nIn every *Person* node the properties *name* and *born* must be different:\n```\nCREATE CONSTRAINT ON (p:Person) ASSERT (p.name, p.born) IS NODE KEY\n```\n\n### Managing Indexes\n\n#### Indexes for range searches\n\n```\nMATCH (m:Movie)\nWHERE 1990 \u003c m.released \u003c 2000\nSET m.videoFormat = 'DVD'\n```\n\n#### Creating indexes\n\n```\nCREATE INDEX ON :Movie(released)\n```\n\n#### Retrieving indexes\n\n```\nCALL db.indexes()\n```\n\n#### Dropping indexes\n\n```\nDROP INDEX ON :Movie(released, videoFormat)\n```\n\n## Importing Data\n\nIn cypher you can:\n\n- Load data from a URL (http(s) or file).\n- Process data as a stream of records.\n- Create or update the graph with the data being loaded.\n- Use transactions during the load.\n- Transform and convert values from the load stream.\n- Load up to 10M nodes and relationships.\n\nExample datasets:\n\n**movies_to_load.csv**\n```\nid,title,country,year,summary\n1,Wall Street,USA,1987, Every dream has a price.\n2,The American President,USA,1995, Why can't the most powerful man in the world have the one thing he wants most?\n3,The Shawshank Redemption,USA,1994, Fear can hold you prisoner. Hope can set you free.\n```\n**persons_to_load.csv**\n```\nId,name,birthyear\n1,Charlie Sheen, 1965\n2,Oliver Stone, 1946\n3,Michael Douglas, 1944\n4,Martin Sheen, 1940\n5,Morgan Freeman, 1937\n```\n**roles_to_load.csv**\n```\npersonId,movieId,role\n1,1,Bud Fox\n4,1,Carl Fox\n3,1,Gordon Gekko\n4,2,A.J. MacInerney\n3,2,President Andrew Shepherd\n5,3,Ellis Boyd 'Red' Redding\n```\n\n### Importing normalized data\n\n```\nLOAD CSV WITH HEADERS FROM url-value //url-value can be a resource or a file on your system\nAS row        // row is a variable that is used to extract data\n```\n\n\n\nCounting data from the dataset, to get an idea of how much data will get loaded.\n```\nLOAD CSV WITH HEADERS\nFROM 'http://data.neo4j.com/intro-neo4j/movies_to_load.csv'\nAS line\nRETURN count(*)\n```\n\nVisually inspect a little piece of data to see if it is exactly as you expected it.\n```\nLOAD CSV WITH HEADERS\nFROM 'https://data.neo4j.com/intro-neo4j/movies_to_load.csv'\nAS line\nRETURN * LIMIT 1\n```\n\nFormatting the data before it's loaded (notice the use of *trim()* to clean up strings from accidental whitespaces).\n```\nLOAD CSV WITH HEADERS\nFROM 'http://data.neo4j.com/intro-neo4j/movies_to_load.csv'\nAS line\nRETURN line.id, line.title, toInteger(line.year), trim(line.summary)\n```\n\nThis query specifically creates *Movie* nodes from the CSV data.\n```\nLOAD CSV WITH HEADERS\nFROM 'https://data.neo4j.com/intro-neo4j/movies_to_load.csv'\nAS line\nCREATE (movie:Movie { movieId: line.id, title: line.title, released: toInteger(line.year) , tagline: trim(line.summary)})\n```\n\nThis query will create the *Person* nodes. Notice we are using `MERGE` to avoid duplicate data.\n```\nLOAD CSV WITH HEADERS\nFROM 'https://data.neo4j.com/intro-neo4j/persons_to_load.csv'\nAS line\nMERGE (actor:Person { personId: line.Id })\nON CREATE SET actor.name = line.name,\n              actor.born = toInteger(trim(line.birthyear))\n```\n\nThis query will create the *ACTED_IN* relationship.\n```\nLOAD CSV WITH HEADERS\nFROM 'https://data.neo4j.com/intro-neo4j/roles_to_load.csv'\nAS line\nMATCH (movie:Movie { movieId: line.movieId })\nMATCH (person:Person { personId: line.personId })\nCREATE (person)-[:ACTED_IN { roles: [line.role]}]-\u003e(movie)\n```\n\n### Importing denormalized data\n\nDataset:\n\n**movie_actor_roles_to_load.csv**\n```\ntitle;released;summary;actor;birthyear;characters\nBack to the Future;1985;17 year old Marty McFly got home early last night. 30 years early.;Michael J. Fox;1961;Marty McFly\nBack to the Future;1985;17 year old Marty McFly got home early last night. 30 years early.;Christopher Lloyd;1938;Dr. Emmet Brown\n```\n\nTo load this data you use these Cypher statements:\n```\nLOAD CSV WITH HEADERS\nFROM 'https://data.neo4j.com/intro-neo4j/movie_actor_roles_to_load.csv'\nAS line FIELDTERMINATOR ';'\nMERGE (movie:Movie { title: line.title })\nON CREATE SET movie.released = toInteger(line.released),\n              movie.tagline = line.summary\nMERGE (actor:Person { name: line.actor })\nON CREATE SET actor.born = toInteger(line.birthyear)\nMERGE (actor)-[r:ACTED_IN]-\u003e(movie)\nON CREATE SET r.roles = split(line.characters,',')\n```\n\n### Importing a large dataset\n\n⚠️ Uploading more than 100,000 rows of data? It is recommended to prefix your `LOAD CSV` clause with a `PERIODIC COMMIT` hint. This allows the database to regularly commit the import transactions to avoid memory churn for large transaction-states. ⚠️\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfede%2Fcypher-cheat-sheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitfede%2Fcypher-cheat-sheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfede%2Fcypher-cheat-sheet/lists"}