Closed marcuslindblom closed 5 years ago
According to the documentation it seems like you first need to get the current value and then use the index when you delete the key. It seems like you always put 0
as the index in the DeleteCompareExchangeValueOperation
From the docs
// First, get existing value
CompareExchangeValue<User> readResult =
store.Operations.Send(
new GetCompareExchangeValueOperation<User>("AdminUser"));
// Delete the key - use the index received from the 'Get' operation
CompareExchangeResult<User> deleteResult
= store.Operations.Send(
new DeleteCompareExchangeValueOperation<User>("AdminUser", readResult.Index));
// The delete result is successful only if the index has not changed between the read and delete operations
bool deleteResultSuccessful = deleteResult.Successful;
Investigating. I'll get back to you today with a fix.
OK Marcus, this is fixed. I've published an update to NuGet (v6.0.2) as well.
Thanks for the bug report.
I use the
6.0.1
and when I try to delete a user I get the errorUnable to delete user email compare/exchange value
. I use RavenDB4.1.3
.