Importing Order Nodes
You imported Product and Customer nodes. Now import Order nodes.
The orders.csv file is already loaded in your Import tool.
Map the Order node
In the Data Modeling tab:
-
Click the + Node Label button to add a new node
-
Set the label: Under Definition, set the label to
Order -
Select the table: Under Table, select
orders.csv
Configure properties
Use the Map from table button and select these columns:
| Column | Type | Rename To |
|---|---|---|
orderID |
Integer |
id |
orderDate |
DateTime |
date |
shipCountry |
String |
|
shipCity |
String |
Verify the ID property is set to id.
Date Properties
The orderDate column should be converted to a DateTime type.
The Import tool will coerce the string value into a DateTime object during import.
To run comparisons on this property in Cypher, use the datetime() function:
MATCH (o:Order)
WHERE o.date > datetime('2024-01-01')
RETURN oRun the import
Click the Run Import button. You should see confirmation that 830 Order nodes were created.
Validate Import
Once you have imported the Order nodes, click the Check Database button to verify that the task is complete.
Hint
Follow the same steps as the previous lessons where you imported Product and Customer nodes.
Make sure to:
-
Set the label to
Order -
Map from
orders.csv -
Set
orderIdas the ID property -
Click Preview to review
-
Click Run Import
Solution
The Order node should be configured with:
-
Label:
Order -
File: orders.csv
-
ID property: orderId
-
Key properties: orderDate, shipCountry, shipCity
After running the import, you should have 830 Order nodes in your graph.
Download Solution
If you are having trouble, you can download the solution model and open it using the Open model (with data) option.
-
Download 6-import-orders.zip
-
In the Import tool, click the 3-dot menu (…) and select Open model (with data)
-
Select the downloaded zip file
Summary
You imported Order nodes into your graph:
-
Created 830 Order nodes
-
Renamed
orderIDtoidandorderDatetodate -
Converted date strings to DateTime type
In the next module, you’ll create relationships to connect these nodes together.