Hello neo4j team/experts I am using neo4j community 2.2.3 through the Transactional Cypher HTTP endpoint and javascript code for user interface. I want to allow a user to periodically add a number of electronic components to the database from csv files.
The components are each represented by nodes, and I want to create a relationship from each component to a single node representing the time and date of the reading of the relevant csv file. (each time a new csv file is opened for reading, one new node is created, representing the reading of that file). Since each new csv file can contain components that already exist in the database, I want to avoid duplicates and make no changes to the db in case the newly read component is MATCH ed. But if a new component was *CREATE *d, I need to create both the component node AND a relationship from it to the node representing the csv file read. So *MERGE/ON CREATE* seems a natural candidate clause to use, however *ON CREATE* only seems to allow me to SET properties, not create relationships, unless I missed something. I suppose It's possible to do it in two subsequent queries, one for node creation and storing the node id's and the next for creating the relationships using the stored id's, but my question is can it be done in one (elegant) query? maybe *ON CREATE* has more capabilities than documented? Is there another approach to doing that? I want either no changes to the db at all (if component already exists), or a node+relationship created. I'm a beginner in this, so any help/ideas would be greatly appreciated. Thanks in advance. -- 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.
