Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deletion of nonexisting nodes. #62

Open
Ragnar-BY opened this issue Dec 24, 2018 · 0 comments
Open

Deletion of nonexisting nodes. #62

Ragnar-BY opened this issue Dec 24, 2018 · 0 comments

Comments

@Ragnar-BY
Copy link

I have next code:

DeleteNodes = "MATCH (n) DETACH DELETE n;"
func (s *Service) cleanUp(storage bolt.Conn) error {
	result, err := storage.ExecNeo(DeleteNodes, nil)
	if err != nil {
		return fmt.Errorf("bad DELETE request")
	}
	numResult, err := result.RowsAffected()
	if err != nil {
		return err
	}
	fmt.Printf("Rows Deleted: %d", numResult)
	return nil
}

This code works well but only if database is not null. If there are not nodes in database, then I get error Unrecognized type for stats metadata: map[string]interface {}{"result_consumed_after":0, "type":"w"} in function result.RowsAffected()
In my opinion we should not get error here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant