简体   繁体   中英

How to set the lable on node in neo4j?

I'm new to neo4j and I'm facing issue to set the node's label.

I create a new node using this code.

create(s:Student{id:'QWERTY',age:20,first_name:'Sachin',last_name:'Shah'}) 
return s.first_name

AND (without return a node data)

create(s:Student{id:'fjfktejfkahjgkjafiejg',age:20,first_name:'Sachin',
last_name:'Shah'})

By this command, I'm able to create a new node and I can see the node in a graph view.

It looks like this.

在此处输入图片说明

I didn't understand that why it's label is showing a blank? I need to set the user's first_name as a label while creating a new node.

I am adding an example to select a default caption. (FYI What you are asking is called caption, Label means different in Neo4j, Here "Student" is the label).

Click on the Label (Red colored selection) and select the caption property from the bottom of the tab(Blue colored selection). 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM