Reader small image

You're reading from  Graph Data Processing with Cypher

Product typeBook
Published inDec 2022
PublisherPackt
ISBN-139781804611074
Edition1st Edition
Concepts
Right arrow
Author (1)
Ravindranatha Anthapu
Ravindranatha Anthapu
author image
Ravindranatha Anthapu

Ravindranatha Anthapu has more than 25 years of experience in working with W3C standards or building cutting-edge technologies like integrating speech with mobile applications in the 2000s. He is a technology enthusiast who worked from operating system device drivers to writing compilers for C language to modern web technologies, transitioning seamlessly and bringing experience from each of these domains and technologies to deliver successful solutions today. As a Principal Consultant at Neo4j today, Ravindranatha works with large enterprise customers to make sure they are able to leverage graph technologies effectively across various domains.
Read more about Ravindranatha Anthapu

Right arrow

Working with maps

In this section, we will take a look at working with maps in Cypher. Maps in Cypher represent key-value pairs. The keys must be strings and values can be any object. Maps can be defined in Cypher inline, where they are called literal maps, or they can be passed as parameters. Every node and relationship object can also be treated as a map in Cypher, so that we can access all the properties using dot (.) notation or index ([ ]) notation.

A map is like a JavaScript Object Notation (JSON) object. A sample JSON object looks like this:

{
  "firstName": "John",
  "lastName": "Smith",
  "isAlive": true,
  "age": 27
}

If we represented the same map in Cypher, it would look like this:

WITH {
  firstName: "John",
  lastName: "Smith",
  isAlive: true,
  age: 27
} as map
RETURN map

We can see from the code...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Graph Data Processing with Cypher
Published in: Dec 2022Publisher: PacktISBN-13: 9781804611074

Author (1)

author image
Ravindranatha Anthapu

Ravindranatha Anthapu has more than 25 years of experience in working with W3C standards or building cutting-edge technologies like integrating speech with mobile applications in the 2000s. He is a technology enthusiast who worked from operating system device drivers to writing compilers for C language to modern web technologies, transitioning seamlessly and bringing experience from each of these domains and technologies to deliver successful solutions today. As a Principal Consultant at Neo4j today, Ravindranatha works with large enterprise customers to make sure they are able to leverage graph technologies effectively across various domains.
Read more about Ravindranatha Anthapu