N1QL execute using QueryRequest, status responded with Success, MutationCount equals 1 but nothing changed on Couchbase server

I know it’s 2020, but has anyone figured this out? I am also using .NET 2.7 SDK to execute an update statement directly to the cluster where _N1Q1Query is my update statement to be executed.

        IQueryRequest request = new QueryRequest();

MutationCount returned 1. But the document sometimes update and sometimes do not. Success rate is 80% of the time. It seems like there is a bug in the Couchbase Database Server.

Please post the exact query and sample document.
Once WHERE clause is true the document is counted as mutated.
Actual mutation depends on various things.
Is SET path exist
Is there any cas mismatch

Did you try in UI.

Sample Data
status = “In Progress”
type = “QtQ”
id = 123

C# Code
Cluster _cluster = new Cluster(new ClientConfiguration
Servers = uriList <==== I added all the nodes as array
_cluster.Authenticate(authenticator); <===Credential to nodes

           IBucket _bucket = _cluster.OpenBucket("QBucket");

var _N1QLQuery = “UPDATE QBucket SET status = ‘Completed’ where type = ‘QtQ’ and id = 123”;

    IQueryRequest request = new QueryRequest();

IQueryResult result = _bucket.QueryAsync(request).Result;

You are doing Async. Did check errors in callback.
Did you executed Query workbench.


This isn’t related to your specific question, but using .Result on an async Task that might not be complete is an anti-pattern. It can cause deadlocks and thread pool depletion in your application. You should await the query instead.

I also recommend adding result.EnsureSuccessful(), which will cause an exception if there was an error executing the query. That might expose your problem.

Do I call EnsureSuccess after?

Can I do this?
IQueryResult result = _bucket.Query(request);

Yes, that will work if you want to run it synchronously.