Creating More Nodes

We want to add a couple of User nodes to the graph so we can test the changes to our model.

Any User node will have the following properties:

  • userId - an integer (eg. 123)

  • name - a string (eg. User’s Name)

Use the sandbox window to the right to create two User nodes for:

  1. 'Sandy Jones' with the userId of 534

  2. 'Clinton Spencer' with the userId of 105

Modify the MERGE statement in the Sandbox window to find or create the two users in the database.

You can either create the two nodes in one query, or create the nodes in two separate queries.

Validate Results

Once you have run the query, click the Check Database button and we will check the database for you.

Hint

We are expecting two new User nodes in the Sandbox.

Add Sandy Jones and Clinton Spencer using MERGE, making sure we also add their userId values.

Solution

Click Run in Sandbox to execute to Cypher to merge the two new User nodes in the database.

cypher
MERGE (sandy:User {userId: 534}) SET sandy.name = "Sandy Jones"
MERGE (clinton:User {userId: 105}) SET clinton.name = "Clinton Spencer"

Summary

In this challenge, you demonstrated that you can create some nodes to support your instance model.

Your instance model should now look like this:

Instance Model thus far

In the next module, you will learn how to add relationships to your model.