Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Neo4j Graph Data Modelling
  • Toc
  • feedback
Neo4j Graph Data Modelling

Neo4j Graph Data Modelling

By : Mahesh K Lal
3 (1)
close
Neo4j Graph Data Modelling

Neo4j Graph Data Modelling

3 (1)
By: Mahesh K Lal

Overview of this book

If you are a developer who wants to understand the fundamentals of modeling data in Neo4j and how it can be used to model full-fledged applications, then this book is for you. Some understanding of domain modeling may be advantageous but is not essential.
Table of Contents (11 chapters)
close
10
Index

Creating bookings and users in Neo4j


For bookings to exist, we should create users in our data model.

Note

As with earlier chapters, please download the queries from the downloadable code bundle available with this book. Alternatively, the queries can also be downloaded from https://github.com/maheshlal2910/neo4j_graph_data_modelling.

Creating users

To create users, we create a constraint on the e-mail of the user, which we will use as an unique identifier as shown in the following query:

neo4j-sh (?)$ CREATE CONSTRAINT ON (user:User) ASSERT user.email IS UNIQUE;

The output of the preceding query is as follows:

+-------------------+
| No data returned. |
+-------------------+
Constraints added: 1

With the constraint added, let's create a few users in our system:

neo4j-sh (?)$ CREATE (:User{name:"Mahesh Lal", email:"[email protected]"}),
  (:User{name:"John Doe", email:"[email protected]"}),
  (:User{name:"Vishal P", email:"[email protected]"}),
  (:User{name:"Dave Coeburg", email:"dave.coeburg...
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete