cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Anyone using Grandstack and neo4j-driver.js together at the same time? or: deleting children (do i have to loop?)

jonathan
Node Clone

I don't have much experience with using the neo4j-driver.js library itself but I can't help but think using this driver in a separate nodejs microservice for certain operations might just be a better solution for some things. I'd love some feedback or advice on this. The example that leads me to this conclusion is simply that If I am trying to delete a node that has many nested relationships, what is the best way to go about this? If i were to use Grandstack, i would have to loop through many nested ID's and delete them where I am pretty sure there is some CYPHER to just delete a node and all relationships and nodes under it in one command?

looping through and running this for every nested relationship of an asset -> victim

export const DELETE_ASSET_VICTIM_RELATIONSHIP = gql`
  mutation RemoveAssetVictim($from: ID!, $to: ID!) {
    RemoveAssetVictim(from: { id: $from }, to: { id: $to }) {
      from {
        id
      }
      to {
        id
      }
    }
  }
`;

deleting a node with all it's children:

DETACH DELETE

0 REPLIES 0