cancel
Showing results for 
Search instead for 
Did you mean: 

Delete limit GraphQL

awtsmoos-1
Node

B"H

In the delete tutorial https://neo4j.com/docs/graphql-manual/current/mutations/delete/

I'm trying to figure out how to only delete a certain amount of nodes that don't have a unique ID each.

Under the filtering tutorial it mentioned an options argument where one can add limit, but it doesn't work in delete

The standard command, like for this response:

{
  "data": {
    "people": [
      {
        "name": "Coby"
      },
      {
        "name": "Coby"
      }
    ]
  }
}

to do this mutation:

mutation d {
  deletePeople(where: {
    name: "Coby"
  }) {
    nodesDeleted
  }
}

with this type definition:

    const typeDefs = gql`
    type Person {
      name: String
      knows: [Person!]! @relationship(type: "KNOWS", direction: OUT)
      friendCount: Int @cypher(statement:"match (p:Person)-[r:KNOWS]->(:Person) RETURN count(r)")
    }
  `;

would delete all nodes. I want to only delete one [or a limited amount of] node[s].

How can I do that [without adding a unique id?]

0 REPLIES 0