Trần Tuấn Anh
Trần Tuấn Anh

Reputation: 333

Can't save to Neo4j database

I am trying to create a Spring Boot project with Neo4j. I connected successfully with Neo4j. But when I save data to Neo4j, it has error. Below is my project:

User:

enter image description here

UserRepository: enter image description here User Controller: enter image description here UserService: enter image description here

And when I call API signup to save user to Neo4j. It has error in UserService at line "userRepository.save(user);". Here is it: enter image description here

Thank you so much in advance!

Upvotes: 1

Views: 103

Answers (1)

Michael Hunger
Michael Hunger

Reputation: 41676

Do you by chance created two users in your database with the same id?

Can you please check that? A good way to avoid that is to

create constraint on (u:User) assert u.id is unique;

Upvotes: 1

Related Questions