#{#n1ql.delete} deletes the document but not seeing an option to know if the deletion was successful

Team,
I am using spring-data-couchbase dependency and I have a requirement, which needs to delete documents based on list of document ids. This annotation : @Query(“#{#n1ql.delete} USE KEYS $1”) helps in deleting the documents but not seeing an option to know if the delete operation was successful.

This is not helping as it throws NullPointerExcpetion in JsonObject.getLong : @Query(“#{#n1ql.delete} USE KEYS $1 RETURNING META().id”)

Basically, I would want to know if the deletion was successful like returning the deleted documents ids or a boolean also will suffice. Please help with any options if it exists?

Hi - Use the solution from Spring data JPA delete all returns void but generated query has returning claus

For a non-reactive repository, the return type would be User instead of Mono.

  • Mike
1 Like

@mreiche Thanks, this works.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.