1
votes

I am using spring data couchbase and I want to write a custom query for deleting all the docs based on some condition I have below query written down:

@Query("#{#n1ql.delete} WHERE #{#n1ql.filter} AND " +
     "accountId = $1 #{#n1ql.returning}")
  Mono<Void> delete(String accountId);

But this does not seem to be working. Please help me to fix this issue.

1

1 Answers

0
votes

What version are you using? Please show the calling code and how you determine it does not work. Two things to check- If the document to be deleted was just inserted, it may not yet have been indexed. This is a reactive repository - tbe n1ql wiil not be executed unless the result is collected.