Hi,

I try to update the relationship of a Node that is a collection.
Example: User has a list of Cars.

Firstly, I saved the User with the Cars set beforehand, and the whole works 
with embedded mode and REST mode.

Now, I want to add one Car to the list of this User. 

So I tried the following:  (Scala code but easy to figure out)

val tx = graphDatabaseService.beginTx()
          val user = userRepository.findById(1)
          user.cars.clear()   //cars being the relationships (Set[Cars])
          user.cars.add(new Car("Ferrari"))
          userRepository.save(user)           // fail with embedded but 
works with REST mode !
tx.success()


Is it the right way to update the collection ?
Is there something special on the embedded mode handling ?

Thanks,

Michael



-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to